Fix PHPDoc comments project-wide
This commit is contained in:
parent
6077aa5847
commit
3282ce5389
113 changed files with 1703 additions and 795 deletions
|
@ -23,6 +23,7 @@ class APContact extends BaseObject
|
|||
*
|
||||
* @param string $addr profile address (user@domain.tld)
|
||||
* @return string url
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
private static function addrToUrl($addr)
|
||||
{
|
||||
|
@ -63,6 +64,8 @@ class APContact extends BaseObject
|
|||
* @param string $url profile url
|
||||
* @param boolean $update true = always update, false = never update, null = update when not found or outdated
|
||||
* @return array profile array
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function getByURL($url, $update = null)
|
||||
{
|
||||
|
|
|
@ -25,6 +25,7 @@ class Attach extends BaseObject
|
|||
* @brief Return a list of fields that are associated with the attach table
|
||||
*
|
||||
* @return array field list
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function getFields()
|
||||
{
|
||||
|
@ -37,13 +38,14 @@ class Attach extends BaseObject
|
|||
/**
|
||||
* @brief Select rows from the attach table
|
||||
*
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return boolean|array
|
||||
*
|
||||
* @see \Friendica\Database\DBA::select
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::select
|
||||
*/
|
||||
public static function select(array $fields = [], array $conditions = [], array $params = [])
|
||||
{
|
||||
|
@ -58,13 +60,14 @@ class Attach extends BaseObject
|
|||
/**
|
||||
* @brief Retrieve a single record from the attach table
|
||||
*
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return bool|array
|
||||
*
|
||||
* @see \Friendica\Database\DBA::select
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::select
|
||||
*/
|
||||
public static function selectFirst(array $fields = [], array $conditions = [], array $params = [])
|
||||
{
|
||||
|
@ -78,9 +81,10 @@ class Attach extends BaseObject
|
|||
/**
|
||||
* @brief Check if attachment with given conditions exists
|
||||
*
|
||||
* @param array $conditions Array of extra conditions
|
||||
* @param array $conditions Array of extra conditions
|
||||
*
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function exists(array $conditions)
|
||||
{
|
||||
|
@ -89,12 +93,13 @@ class Attach extends BaseObject
|
|||
|
||||
/**
|
||||
* @brief Retrive a single record given the ID
|
||||
*
|
||||
* @param int $id Row id of the record
|
||||
*
|
||||
*
|
||||
* @param int $id Row id of the record
|
||||
*
|
||||
* @return bool|array
|
||||
*
|
||||
* @see \Friendica\Database\DBA::select
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::select
|
||||
*/
|
||||
public static function getById($id)
|
||||
{
|
||||
|
@ -102,13 +107,14 @@ class Attach extends BaseObject
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Retrive a single record given the ID
|
||||
*
|
||||
* @param int $id Row id of the record
|
||||
*
|
||||
* @brief Retrive a single record given the ID
|
||||
*
|
||||
* @param int $id Row id of the record
|
||||
*
|
||||
* @return bool|array
|
||||
*
|
||||
* @see \Friendica\Database\DBA::select
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::select
|
||||
*/
|
||||
public static function getByIdWithPermission($id)
|
||||
{
|
||||
|
@ -131,10 +137,11 @@ class Attach extends BaseObject
|
|||
|
||||
/**
|
||||
* @brief Get file data for given row id. null if row id does not exist
|
||||
*
|
||||
* @param array $item Attachment data. Needs at least 'id', 'backend-class', 'backend-ref'
|
||||
*
|
||||
*
|
||||
* @param array $item Attachment data. Needs at least 'id', 'backend-class', 'backend-ref'
|
||||
*
|
||||
* @return string file data
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getData($item)
|
||||
{
|
||||
|
@ -155,7 +162,7 @@ class Attach extends BaseObject
|
|||
/**
|
||||
* @brief Store new file metadata in db and binary in default backend
|
||||
*
|
||||
* @param string $data Binary data
|
||||
* @param string $data Binary data
|
||||
* @param integer $uid User ID
|
||||
* @param string $filename Filename
|
||||
* @param string $filetype Mimetype. optional, default = ''
|
||||
|
@ -166,6 +173,7 @@ class Attach extends BaseObject
|
|||
* @param string $deny_gid Permissions, denied greoup.optional, default = ''
|
||||
*
|
||||
* @return boolean/integer Row id on success, False on errors
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public function store($data, $uid, $filename, $filetype = '' , $filesize = null, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '')
|
||||
{
|
||||
|
@ -214,7 +222,15 @@ class Attach extends BaseObject
|
|||
/**
|
||||
* @brief Store new file metadata in db and binary in default backend from existing file
|
||||
*
|
||||
* @param $src
|
||||
* @param $uid
|
||||
* @param string $filename
|
||||
* @param string $allow_cid
|
||||
* @param string $allow_gid
|
||||
* @param string $deny_cid
|
||||
* @param string $deny_gid
|
||||
* @return boolean True on success
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public function storeFile($src, $uid, $filename = '', $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '')
|
||||
{
|
||||
|
@ -233,12 +249,13 @@ class Attach extends BaseObject
|
|||
*
|
||||
* @param array $fields Contains the fields that are updated
|
||||
* @param array $conditions Condition array with the key values
|
||||
* @param string $data File data to update. Optional, default null.
|
||||
* @param Image $img Image data to update. Optional, default null.
|
||||
* @param array|boolean $old_fields Array with the old field values that are about to be replaced (true = update on duplicate)
|
||||
*
|
||||
* @return boolean Was the update successfull?
|
||||
* @return boolean Was the update successful?
|
||||
*
|
||||
* @see \Friendica\Database\DBA::update
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @see \Friendica\Database\DBA::update
|
||||
*/
|
||||
public static function update($fields, $conditions, $img = null, array $old_fields = [])
|
||||
{
|
||||
|
@ -265,12 +282,13 @@ class Attach extends BaseObject
|
|||
/**
|
||||
* @brief Delete info from table and data from storage
|
||||
*
|
||||
* @param array $conditions Field condition(s)
|
||||
* @param array $options Options array, Optional
|
||||
* @param array $conditions Field condition(s)
|
||||
* @param array $options Options array, Optional
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @see \Friendica\Database\DBA::delete
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::delete
|
||||
*/
|
||||
public static function delete(array $conditions, array $options = [])
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ use Friendica\Util\Strings;
|
|||
class Contact extends BaseObject
|
||||
{
|
||||
/**
|
||||
* @name page/profile types
|
||||
* Page/profile types
|
||||
*
|
||||
* PAGE_NORMAL is a typical personal profile account
|
||||
* PAGE_SOAPBOX automatically approves all friend requests as Contact::SHARING, (readonly)
|
||||
|
@ -81,7 +81,7 @@ class Contact extends BaseObject
|
|||
*/
|
||||
|
||||
/**
|
||||
* @name Contact_is
|
||||
* Contact_is
|
||||
*
|
||||
* Relationship types
|
||||
* @{
|
||||
|
@ -100,6 +100,8 @@ class Contact extends BaseObject
|
|||
* @param int $uid User ID
|
||||
*
|
||||
* @return boolean is the contact id a follower?
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function isFollower($cid, $uid)
|
||||
{
|
||||
|
@ -118,11 +120,13 @@ class Contact extends BaseObject
|
|||
|
||||
/**
|
||||
* @brief Get the basepath for a given contact link
|
||||
* @todo Add functionality to store this value in the contact table
|
||||
* @todo Add functionality to store this value in the contact table
|
||||
*
|
||||
* @param string $url The contact link
|
||||
*
|
||||
* @return string basepath
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function getBasepath($url)
|
||||
{
|
||||
|
@ -142,6 +146,8 @@ class Contact extends BaseObject
|
|||
* @param int $uid User ID
|
||||
*
|
||||
* @return array with public and user's contact id
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function getPublicAndUserContacID($cid, $uid)
|
||||
{
|
||||
|
@ -179,6 +185,7 @@ class Contact extends BaseObject
|
|||
* @param int $cid Either public contact id or user's contact id
|
||||
* @param int $uid User ID
|
||||
* @param boolean $blocked Is the contact blocked or unblocked?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function setBlockedForUser($cid, $uid, $blocked)
|
||||
{
|
||||
|
@ -201,6 +208,7 @@ class Contact extends BaseObject
|
|||
* @param int $uid User ID
|
||||
*
|
||||
* @return boolean is the contact id blocked for the given user?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function isBlockedByUser($cid, $uid)
|
||||
{
|
||||
|
@ -240,6 +248,7 @@ class Contact extends BaseObject
|
|||
* @param int $cid Either public contact id or user's contact id
|
||||
* @param int $uid User ID
|
||||
* @param boolean $ignored Is the contact ignored or unignored?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function setIgnoredForUser($cid, $uid, $ignored)
|
||||
{
|
||||
|
@ -262,6 +271,7 @@ class Contact extends BaseObject
|
|||
* @param int $uid User ID
|
||||
*
|
||||
* @return boolean is the contact id ignored for the given user?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function isIgnoredByUser($cid, $uid)
|
||||
{
|
||||
|
@ -301,6 +311,7 @@ class Contact extends BaseObject
|
|||
* @param int $cid Either public contact id or user's contact id
|
||||
* @param int $uid User ID
|
||||
* @param boolean $collapsed are the contact's posts collapsed or uncollapsed?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function setCollapsedForUser($cid, $uid, $collapsed)
|
||||
{
|
||||
|
@ -319,6 +330,8 @@ class Contact extends BaseObject
|
|||
* @param int $uid User ID
|
||||
*
|
||||
* @return boolean is the contact id blocked for the given user?
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function isCollapsedByUser($cid, $uid)
|
||||
{
|
||||
|
@ -344,6 +357,7 @@ class Contact extends BaseObject
|
|||
*
|
||||
* @param int $gid
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getByGroupId($gid)
|
||||
{
|
||||
|
@ -378,6 +392,7 @@ class Contact extends BaseObject
|
|||
*
|
||||
* @param int $gid
|
||||
* @return int
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getOStatusCountByGroupId($gid)
|
||||
{
|
||||
|
@ -406,6 +421,7 @@ class Contact extends BaseObject
|
|||
*
|
||||
* @param int $uid
|
||||
* @return bool Operation success
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function createSelfFromUserId($uid)
|
||||
{
|
||||
|
@ -450,8 +466,9 @@ class Contact extends BaseObject
|
|||
/**
|
||||
* Updates the self-contact for the provided user id
|
||||
*
|
||||
* @param int $uid
|
||||
* @param int $uid
|
||||
* @param boolean $update_avatar Force the avatar update
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function updateSelfFromUserID($uid, $update_avatar = false)
|
||||
{
|
||||
|
@ -552,6 +569,7 @@ class Contact extends BaseObject
|
|||
*
|
||||
* @param int $id contact id
|
||||
* @return null
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function remove($id)
|
||||
{
|
||||
|
@ -575,6 +593,8 @@ class Contact extends BaseObject
|
|||
* @param array $contact Contact unfriended
|
||||
* @param boolean $dissolve Remove the contact on the remote side
|
||||
* @return void
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function terminateFriendship(array $user, array $contact, $dissolve = false)
|
||||
{
|
||||
|
@ -620,6 +640,7 @@ class Contact extends BaseObject
|
|||
*
|
||||
* @param array $contact contact to mark for archival
|
||||
* @return null
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function markForArchival(array $contact)
|
||||
{
|
||||
|
@ -668,10 +689,11 @@ class Contact extends BaseObject
|
|||
/**
|
||||
* @brief Cancels the archival countdown
|
||||
*
|
||||
* @see Contact::markForArchival()
|
||||
* @see Contact::markForArchival()
|
||||
*
|
||||
* @param array $contact contact to be unmarked for archival
|
||||
* @return null
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function unmarkForArchival(array $contact)
|
||||
{
|
||||
|
@ -715,6 +737,7 @@ class Contact extends BaseObject
|
|||
* @param array $default If not data was found take this data as default value
|
||||
*
|
||||
* @return array Contact data
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function getDetailsByURL($url, $uid = -1, array $default = [])
|
||||
{
|
||||
|
@ -857,6 +880,8 @@ class Contact extends BaseObject
|
|||
* @param int $uid User id
|
||||
*
|
||||
* @return array Contact data
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function getDetailsByAddr($addr, $uid = -1)
|
||||
{
|
||||
|
@ -912,6 +937,8 @@ class Contact extends BaseObject
|
|||
* @param array $contact contact
|
||||
* @param int $uid optional, default 0
|
||||
* @return array
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function photoMenu(array $contact, $uid = 0)
|
||||
{
|
||||
|
@ -1025,10 +1052,7 @@ class Contact extends BaseObject
|
|||
* Returns either the total number of ungrouped contacts for the given user
|
||||
* id or a paginated list of ungrouped contacts.
|
||||
*
|
||||
* @param int $uid uid
|
||||
* @param int $start optional, default 0
|
||||
* @param int $count optional, default 0
|
||||
*
|
||||
* @param int $uid uid
|
||||
* @return array
|
||||
*/
|
||||
public static function getUngroupedList($uid)
|
||||
|
@ -1073,6 +1097,8 @@ class Contact extends BaseObject
|
|||
* @param boolean $in_loop Internally used variable to prevent an endless loop
|
||||
*
|
||||
* @return integer Contact ID
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function getIdForURL($url, $uid = 0, $no_update = false, $default = [], $in_loop = false)
|
||||
{
|
||||
|
@ -1330,6 +1356,7 @@ class Contact extends BaseObject
|
|||
* @param int $cid contact id
|
||||
*
|
||||
* @return boolean Is the contact blocked?
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function isBlocked($cid)
|
||||
{
|
||||
|
@ -1355,6 +1382,7 @@ class Contact extends BaseObject
|
|||
* @param int $cid contact id
|
||||
*
|
||||
* @return boolean Is the contact hidden?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function isHidden($cid)
|
||||
{
|
||||
|
@ -1374,7 +1402,10 @@ class Contact extends BaseObject
|
|||
*
|
||||
* @param string $contact_url Contact URL
|
||||
*
|
||||
* @param bool $thread_mode
|
||||
* @param int $update
|
||||
* @return string posts in HTML
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getPostsFromUrl($contact_url, $thread_mode = false, $update = 0)
|
||||
{
|
||||
|
@ -1489,6 +1520,7 @@ class Contact extends BaseObject
|
|||
*
|
||||
* @param int $uid
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function block($uid)
|
||||
{
|
||||
|
@ -1502,6 +1534,7 @@ class Contact extends BaseObject
|
|||
*
|
||||
* @param int $uid
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function unblock($uid)
|
||||
{
|
||||
|
@ -1519,6 +1552,8 @@ class Contact extends BaseObject
|
|||
* @param bool $force force picture update
|
||||
*
|
||||
* @return array Returns array of the different avatar sizes
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function updateAvatar($avatar, $uid, $cid, $force = false)
|
||||
{
|
||||
|
@ -1558,6 +1593,8 @@ class Contact extends BaseObject
|
|||
* @param integer $id contact id
|
||||
* @param string $network Optional network we are probing for
|
||||
* @return boolean
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function updateFromProbe($id, $network = '')
|
||||
{
|
||||
|
@ -1633,7 +1670,9 @@ class Contact extends BaseObject
|
|||
* @param string $url
|
||||
* @param bool $interactive
|
||||
* @param string $network
|
||||
* @return boolean|string
|
||||
* @return array
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function createFromProbe($uid, $url, $interactive = false, $network = '')
|
||||
{
|
||||
|
@ -1848,10 +1887,11 @@ class Contact extends BaseObject
|
|||
/**
|
||||
* @brief Updated contact's SSL policy
|
||||
*
|
||||
* @param array $contact Contact array
|
||||
* @param array $contact Contact array
|
||||
* @param string $new_policy New policy, valid: self,full
|
||||
*
|
||||
* @return array Contact array with updated values
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function updateSslPolicy(array $contact, $new_policy)
|
||||
{
|
||||
|
@ -2055,6 +2095,7 @@ class Contact extends BaseObject
|
|||
* Remove the unavailable contact ids from the provided list
|
||||
*
|
||||
* @param array $contact_ids Contact id list
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function pruneUnavailable(array &$contact_ids)
|
||||
{
|
||||
|
@ -2079,12 +2120,14 @@ class Contact extends BaseObject
|
|||
/**
|
||||
* @brief Returns a magic link to authenticate remote visitors
|
||||
*
|
||||
* @todo check if the return is either a fully qualified URL or a relative path to Friendica basedir
|
||||
* @todo check if the return is either a fully qualified URL or a relative path to Friendica basedir
|
||||
*
|
||||
* @param string $contact_url The address of the target contact profile
|
||||
* @param string $url An url that we will be redirected to after the authentication
|
||||
* @param string $url An url that we will be redirected to after the authentication
|
||||
*
|
||||
* @return string with "redir" link
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function magicLink($contact_url, $url = '')
|
||||
{
|
||||
|
@ -2104,9 +2147,11 @@ class Contact extends BaseObject
|
|||
* @brief Returns a magic link to authenticate remote visitors
|
||||
*
|
||||
* @param integer $cid The contact id of the target contact profile
|
||||
* @param integer $url An url that we will be redirected to after the authentication
|
||||
* @param string $url An url that we will be redirected to after the authentication
|
||||
*
|
||||
* @return string with "redir" link
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function magicLinkbyId($cid, $url = '')
|
||||
{
|
||||
|
@ -2118,10 +2163,12 @@ class Contact extends BaseObject
|
|||
/**
|
||||
* @brief Returns a magic link to authenticate remote visitors
|
||||
*
|
||||
* @param array $contact The contact array with "uid", "network" and "url"
|
||||
* @param string $url An url that we will be redirected to after the authentication
|
||||
* @param array $contact The contact array with "uid", "network" and "url"
|
||||
* @param string $url An url that we will be redirected to after the authentication
|
||||
*
|
||||
* @return string with "redir" link
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function magicLinkbyContact($contact, $url = '')
|
||||
{
|
||||
|
|
|
@ -35,6 +35,7 @@ class Conversation
|
|||
*
|
||||
* @param array $arr Item array with conversation data
|
||||
* @return array Item array with removed conversation data
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function insert(array $arr)
|
||||
{
|
||||
|
|
|
@ -148,6 +148,7 @@ class Event extends BaseObject
|
|||
* @brief Extract bbcode formatted event data from a string.
|
||||
*
|
||||
* @params: string $s The string which should be parsed for event data.
|
||||
* @param $text
|
||||
* @return array The array with the event information.
|
||||
*/
|
||||
public static function fromBBCode($text)
|
||||
|
@ -215,6 +216,7 @@ class Event extends BaseObject
|
|||
*
|
||||
* @param int $event_id Event ID.
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function delete($event_id)
|
||||
{
|
||||
|
@ -233,6 +235,7 @@ class Event extends BaseObject
|
|||
*
|
||||
* @param array $arr Array with event data.
|
||||
* @return int The new event id.
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function store($arr)
|
||||
{
|
||||
|
@ -371,6 +374,7 @@ class Event extends BaseObject
|
|||
* @brief Create an array with translation strings used for events.
|
||||
*
|
||||
* @return array Array with translations strings.
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function getStrings()
|
||||
{
|
||||
|
@ -546,6 +550,8 @@ class Event extends BaseObject
|
|||
*
|
||||
* @param array $event_result Event query array.
|
||||
* @return array Event array for the template.
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function prepareListForTemplate(array $event_result)
|
||||
{
|
||||
|
@ -629,7 +635,6 @@ class Event extends BaseObject
|
|||
*
|
||||
* @param array $events Query result for events.
|
||||
* @param string $format The output format (ical/csv).
|
||||
* @param string $timezone The timezone of the user (not implemented yet).
|
||||
*
|
||||
* @return string Content according to selected export format.
|
||||
*
|
||||
|
@ -741,6 +746,7 @@ class Event extends BaseObject
|
|||
* @param int $uid The user ID.
|
||||
*
|
||||
* @return array Query results.
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function getListByUserId($uid = 0)
|
||||
{
|
||||
|
@ -771,14 +777,15 @@ class Event extends BaseObject
|
|||
|
||||
/**
|
||||
*
|
||||
* @param int $uid The user ID.
|
||||
* @param int $uid The user ID.
|
||||
* @param string $format Output format (ical/csv).
|
||||
* @return array With the results:
|
||||
* bool 'success' => True if the processing was successful,<br>
|
||||
* string 'format' => The output format,<br>
|
||||
* string 'extension' => The file extension of the output format,<br>
|
||||
* string 'content' => The formatted output content.<br>
|
||||
* bool 'success' => True if the processing was successful,<br>
|
||||
* string 'format' => The output format,<br>
|
||||
* string 'extension' => The file extension of the output format,<br>
|
||||
* string 'content' => The formatted output content.<br>
|
||||
*
|
||||
* @throws \Exception
|
||||
* @todo Respect authenticated users with events_by_uid().
|
||||
*/
|
||||
public static function exportListByUserId($uid, $format = 'ical')
|
||||
|
@ -831,6 +838,8 @@ class Event extends BaseObject
|
|||
*
|
||||
* @param array $item Array with item and event data.
|
||||
* @return string HTML output.
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function getItemHTML(array $item) {
|
||||
$same_date = false;
|
||||
|
@ -989,6 +998,7 @@ class Event extends BaseObject
|
|||
* @param array $contact Contact array, expects: id, uid, url, name
|
||||
* @param string $birthday Birthday of the contact
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function createBirthday($contact, $birthday)
|
||||
{
|
||||
|
|
|
@ -134,16 +134,17 @@ class FileTag
|
|||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update file tags in PConfig
|
||||
*
|
||||
* @param int $uid Unique Identity.
|
||||
* @param string $file_old Categories previously associated with an item
|
||||
* @param string $file_new New list of categories for an item
|
||||
* @param string $type Optional file type.
|
||||
*
|
||||
* @return boolean A value indicating success or failure.
|
||||
*/
|
||||
/**
|
||||
* @brief Update file tags in PConfig
|
||||
*
|
||||
* @param int $uid Unique Identity.
|
||||
* @param string $file_old Categories previously associated with an item
|
||||
* @param string $file_new New list of categories for an item
|
||||
* @param string $type Optional file type.
|
||||
*
|
||||
* @return boolean A value indicating success or failure.
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function updatePconfig($uid, $file_old, $file_new, $type = 'file')
|
||||
{
|
||||
if (!intval($uid)) {
|
||||
|
@ -220,15 +221,16 @@ class FileTag
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add tag to file
|
||||
*
|
||||
* @param int $uid Unique identity.
|
||||
* @param int $item_id Item identity.
|
||||
* @param string $file File tag.
|
||||
*
|
||||
* @return boolean A value indicating success or failure.
|
||||
*/
|
||||
/**
|
||||
* @brief Add tag to file
|
||||
*
|
||||
* @param int $uid Unique identity.
|
||||
* @param int $item_id Item identity.
|
||||
* @param string $file File tag.
|
||||
*
|
||||
* @return boolean A value indicating success or failure.
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function saveFile($uid, $item_id, $file)
|
||||
{
|
||||
if (!intval($uid))
|
||||
|
@ -258,16 +260,17 @@ class FileTag
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Remove tag from file
|
||||
*
|
||||
* @param int $uid Unique identity.
|
||||
* @param int $item_id Item identity.
|
||||
* @param string $file File tag.
|
||||
* @param boolean $cat Optional value indicating the term type (i.e. Category or File)
|
||||
*
|
||||
* @return boolean A value indicating success or failure.
|
||||
*/
|
||||
/**
|
||||
* @brief Remove tag from file
|
||||
*
|
||||
* @param int $uid Unique identity.
|
||||
* @param int $item_id Item identity.
|
||||
* @param string $file File tag.
|
||||
* @param boolean $cat Optional value indicating the term type (i.e. Category or File)
|
||||
*
|
||||
* @return boolean A value indicating success or failure.
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function unsaveFile($uid, $item_id, $file, $cat = false)
|
||||
{
|
||||
if (!intval($uid))
|
||||
|
|
|
@ -31,6 +31,7 @@ class GContact
|
|||
* @param string $mode Search mode (e.g. "community")
|
||||
*
|
||||
* @return array with search results
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function searchByName($search, $mode = '')
|
||||
{
|
||||
|
@ -91,6 +92,7 @@ class GContact
|
|||
* @param integer $cid Contact ID
|
||||
* @param integer $zcid Global Contact ID
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function link($gcid, $uid = 0, $cid = 0, $zcid = 0)
|
||||
{
|
||||
|
@ -105,16 +107,16 @@ class GContact
|
|||
/**
|
||||
* @brief Sanitize the given gcontact data
|
||||
*
|
||||
* @param array $gcontact array with gcontact data
|
||||
* @throw Exception
|
||||
*
|
||||
* Generation:
|
||||
* 0: No definition
|
||||
* 1: Profiles on this server
|
||||
* 2: Contacts of profiles on this server
|
||||
* 3: Contacts of contacts of profiles on this server
|
||||
* 4: ...
|
||||
*
|
||||
* @param array $gcontact array with gcontact data
|
||||
* @return array $gcontact
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function sanitize($gcontact)
|
||||
{
|
||||
|
@ -412,6 +414,7 @@ class GContact
|
|||
* @param integer $start optional, default 0
|
||||
* @param integer $limit optional, default 80
|
||||
* @return array
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function suggestionQuery($uid, $start = 0, $limit = 80)
|
||||
{
|
||||
|
@ -515,6 +518,7 @@ class GContact
|
|||
|
||||
/**
|
||||
* @return void
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function updateSuggestions()
|
||||
{
|
||||
|
@ -568,6 +572,7 @@ class GContact
|
|||
* @param string $url Contact url
|
||||
*
|
||||
* @return string Contact url with the wanted parts
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function cleanContactUrl($url)
|
||||
{
|
||||
|
@ -599,6 +604,8 @@ class GContact
|
|||
*
|
||||
* @param array $contact contact array (called by reference)
|
||||
* @return void
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function fixAlternateContactAddress(&$contact)
|
||||
{
|
||||
|
@ -620,6 +627,8 @@ class GContact
|
|||
* @param array $contact contact array
|
||||
*
|
||||
* @return bool|int Returns false if not found, integer if contact was found
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function getId($contact)
|
||||
{
|
||||
|
@ -715,6 +724,8 @@ class GContact
|
|||
* @param array $contact contact array
|
||||
*
|
||||
* @return bool|int Returns false if not found, integer if contact was found
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function update($contact)
|
||||
{
|
||||
|
@ -879,6 +890,8 @@ class GContact
|
|||
*
|
||||
* @param string $url profile link
|
||||
* @return void
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function updateFromProbe($url)
|
||||
{
|
||||
|
@ -898,7 +911,9 @@ class GContact
|
|||
* @brief Update the gcontact entry for a given user id
|
||||
*
|
||||
* @param int $uid User ID
|
||||
* @return void
|
||||
* @return bool
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function updateForUser($uid)
|
||||
{
|
||||
|
@ -949,7 +964,9 @@ class GContact
|
|||
* If the "Statistics" addon is enabled (See http://gstools.org/ for details) we query user data with this.
|
||||
*
|
||||
* @param string $server Server address
|
||||
* @return void
|
||||
* @return bool
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function fetchGsUsers($server)
|
||||
{
|
||||
|
@ -1009,6 +1026,8 @@ class GContact
|
|||
/**
|
||||
* @brief Asking GNU Social server on a regular base for their user data
|
||||
* @return void
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function discoverGsUsers()
|
||||
{
|
||||
|
|
|
@ -22,9 +22,10 @@ class Group extends BaseObject
|
|||
*
|
||||
* Note: If we found a deleted group with the same name, we restore it
|
||||
*
|
||||
* @param int $uid
|
||||
* @param int $uid
|
||||
* @param string $name
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function create($uid, $name)
|
||||
{
|
||||
|
@ -56,10 +57,11 @@ class Group extends BaseObject
|
|||
/**
|
||||
* Update group information.
|
||||
*
|
||||
* @param int $id Group ID
|
||||
* @param int $id Group ID
|
||||
* @param string $name Group name
|
||||
*
|
||||
* @return bool Was the update successful?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function update($id, $name)
|
||||
{
|
||||
|
@ -71,6 +73,7 @@ class Group extends BaseObject
|
|||
*
|
||||
* @param int $cid
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getIdsByContactId($cid)
|
||||
{
|
||||
|
@ -92,9 +95,10 @@ class Group extends BaseObject
|
|||
* Count unread items of each groups of the local user
|
||||
*
|
||||
* @return array
|
||||
* 'id' => group id
|
||||
* 'name' => group name
|
||||
* 'count' => counted unseen group items
|
||||
* 'id' => group id
|
||||
* 'name' => group name
|
||||
* 'count' => counted unseen group items
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function countUnseen()
|
||||
{
|
||||
|
@ -121,9 +125,10 @@ class Group extends BaseObject
|
|||
*
|
||||
* Returns false if no group has been found.
|
||||
*
|
||||
* @param int $uid
|
||||
* @param int $uid
|
||||
* @param string $name
|
||||
* @return int|boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getIdByName($uid, $name)
|
||||
{
|
||||
|
@ -144,6 +149,7 @@ class Group extends BaseObject
|
|||
*
|
||||
* @param int $gid
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function remove($gid) {
|
||||
if (! $gid) {
|
||||
|
@ -188,13 +194,14 @@ class Group extends BaseObject
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Mark a group as deleted based on its name
|
||||
* @brief Mark a group as deleted based on its name
|
||||
*
|
||||
* @deprecated Use Group::remove instead
|
||||
*
|
||||
* @param int $uid
|
||||
* @param int $uid
|
||||
* @param string $name
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function removeByName($uid, $name) {
|
||||
$return = false;
|
||||
|
@ -213,6 +220,7 @@ class Group extends BaseObject
|
|||
* @param int $gid
|
||||
* @param int $cid
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function addMember($gid, $cid)
|
||||
{
|
||||
|
@ -237,6 +245,7 @@ class Group extends BaseObject
|
|||
* @param int $gid
|
||||
* @param int $cid
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function removeMember($gid, $cid)
|
||||
{
|
||||
|
@ -250,14 +259,15 @@ class Group extends BaseObject
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Removes a contact from a group based on its name
|
||||
* @brief Removes a contact from a group based on its name
|
||||
*
|
||||
* @deprecated Use Group::removeMember instead
|
||||
*
|
||||
* @param int $uid
|
||||
* @param int $uid
|
||||
* @param string $name
|
||||
* @param int $cid
|
||||
* @param int $cid
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function removeMemberByName($uid, $name, $cid)
|
||||
{
|
||||
|
@ -271,9 +281,10 @@ class Group extends BaseObject
|
|||
/**
|
||||
* @brief Returns the combined list of contact ids from a group id list
|
||||
*
|
||||
* @param array $group_ids
|
||||
* @param array $group_ids
|
||||
* @param boolean $check_dead
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function expand($group_ids, $check_dead = false)
|
||||
{
|
||||
|
@ -298,10 +309,11 @@ class Group extends BaseObject
|
|||
/**
|
||||
* @brief Returns a templated group selection list
|
||||
*
|
||||
* @param int $uid
|
||||
* @param int $gid An optional pre-selected group
|
||||
* @param int $uid
|
||||
* @param int $gid An optional pre-selected group
|
||||
* @param string $label An optional label of the list
|
||||
* @return string
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function displayGroupSelection($uid, $gid = 0, $label = '')
|
||||
{
|
||||
|
@ -342,12 +354,13 @@ class Group extends BaseObject
|
|||
* @param string $every
|
||||
* @param string $each
|
||||
* @param string $editmode
|
||||
* 'standard' => include link 'Edit groups'
|
||||
* 'extended' => include link 'Create new group'
|
||||
* 'full' => include link 'Create new group' and provide for each group a link to edit this group
|
||||
* @param int $group_id
|
||||
* @param int $cid
|
||||
* 'standard' => include link 'Edit groups'
|
||||
* 'extended' => include link 'Create new group'
|
||||
* 'full' => include link 'Create new group' and provide for each group a link to edit this group
|
||||
* @param string $group_id
|
||||
* @param int $cid
|
||||
* @return string
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function sidebarWidget($every = 'contact', $each = 'group', $editmode = 'standard', $group_id = '', $cid = 0)
|
||||
{
|
||||
|
|
|
@ -263,6 +263,7 @@ class Item extends BaseObject
|
|||
* @brief Fills an array with data from an item query
|
||||
*
|
||||
* @param object $stmt statement object
|
||||
* @param bool $do_close
|
||||
* @return array Data array
|
||||
*/
|
||||
public static function inArray($stmt, $do_close = true) {
|
||||
|
@ -286,6 +287,7 @@ class Item extends BaseObject
|
|||
* @param array $condition array of fields for condition
|
||||
*
|
||||
* @return boolean Are there rows for that condition?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function exists($condition) {
|
||||
$stmt = self::select(['id'], $condition, ['limit' => 1]);
|
||||
|
@ -306,11 +308,12 @@ class Item extends BaseObject
|
|||
*
|
||||
* @brief Retrieve a single record from a table
|
||||
* @param integer $uid User ID
|
||||
* @param array $fields
|
||||
* @param array $condition
|
||||
* @param array $params
|
||||
* @param array $selected
|
||||
* @param array $condition
|
||||
* @param array $params
|
||||
* @return bool|array
|
||||
* @see DBA::select
|
||||
* @throws \Exception
|
||||
* @see DBA::select
|
||||
*/
|
||||
public static function selectFirstForUser($uid, array $selected = [], array $condition = [], $params = [])
|
||||
{
|
||||
|
@ -326,12 +329,13 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Select rows from the item table for a given user
|
||||
*
|
||||
* @param integer $uid User ID
|
||||
* @param array $selected Array of selected fields, empty for all
|
||||
* @param array $condition Array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
* @param integer $uid User ID
|
||||
* @param array $selected Array of selected fields, empty for all
|
||||
* @param array $condition Array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return boolean|object
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function selectForUser($uid, array $selected = [], array $condition = [], $params = [])
|
||||
{
|
||||
|
@ -348,11 +352,12 @@ class Item extends BaseObject
|
|||
* Retrieve a single record from the item table and returns it in an associative array
|
||||
*
|
||||
* @brief Retrieve a single record from a table
|
||||
* @param array $fields
|
||||
* @param array $condition
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @param array $condition
|
||||
* @param array $params
|
||||
* @return bool|array
|
||||
* @see DBA::select
|
||||
* @throws \Exception
|
||||
* @see DBA::select
|
||||
*/
|
||||
public static function selectFirst(array $fields = [], array $condition = [], $params = [])
|
||||
{
|
||||
|
@ -372,11 +377,12 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Select rows from the item table
|
||||
*
|
||||
* @param array $selected Array of selected fields, empty for all
|
||||
* @param array $condition Array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
* @param array $selected Array of selected fields, empty for all
|
||||
* @param array $condition Array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return boolean|object
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function select(array $selected = [], array $condition = [], $params = [])
|
||||
{
|
||||
|
@ -412,12 +418,13 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Select rows from the starting post in the item table
|
||||
*
|
||||
* @param integer $uid User ID
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $condition Array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
* @param integer $uid User ID
|
||||
* @param array $selected
|
||||
* @param array $condition Array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return boolean|object
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function selectThreadForUser($uid, array $selected = [], array $condition = [], $params = [])
|
||||
{
|
||||
|
@ -435,11 +442,12 @@ class Item extends BaseObject
|
|||
*
|
||||
* @brief Retrieve a single record from a table
|
||||
* @param integer $uid User ID
|
||||
* @param array $selected
|
||||
* @param array $condition
|
||||
* @param array $params
|
||||
* @param array $selected
|
||||
* @param array $condition
|
||||
* @param array $params
|
||||
* @return bool|array
|
||||
* @see DBA::select
|
||||
* @throws \Exception
|
||||
* @see DBA::select
|
||||
*/
|
||||
public static function selectFirstThreadForUser($uid, array $selected = [], array $condition = [], $params = [])
|
||||
{
|
||||
|
@ -456,11 +464,12 @@ class Item extends BaseObject
|
|||
* Retrieve a single record from the starting post in the item table and returns it in an associative array
|
||||
*
|
||||
* @brief Retrieve a single record from a table
|
||||
* @param array $fields
|
||||
* @param array $condition
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @param array $condition
|
||||
* @param array $params
|
||||
* @return bool|array
|
||||
* @see DBA::select
|
||||
* @throws \Exception
|
||||
* @see DBA::select
|
||||
*/
|
||||
public static function selectFirstThread(array $fields = [], array $condition = [], $params = [])
|
||||
{
|
||||
|
@ -479,11 +488,12 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Select rows from the starting post in the item table
|
||||
*
|
||||
* @param array $selected Array of selected fields, empty for all
|
||||
* @param array $condition Array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
* @param array $selected Array of selected fields, empty for all
|
||||
* @param array $condition Array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return boolean|object
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function selectThread(array $selected = [], array $condition = [], $params = [])
|
||||
{
|
||||
|
@ -529,6 +539,7 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Returns a list of fields that are associated with the item table
|
||||
*
|
||||
* @param $usermode
|
||||
* @return array field list
|
||||
*/
|
||||
private static function fieldlist($usermode)
|
||||
|
@ -611,10 +622,11 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Returns all needed "JOIN" commands for the "select" functions
|
||||
*
|
||||
* @param integer $uid User ID
|
||||
* @param string $sql_commands The parts of the built SQL commands in the "select" functions
|
||||
* @param boolean $thread_mode Called for the items (false) or for the threads (true)
|
||||
* @param integer $uid User ID
|
||||
* @param string $sql_commands The parts of the built SQL commands in the "select" functions
|
||||
* @param boolean $thread_mode Called for the items (false) or for the threads (true)
|
||||
*
|
||||
* @param $user_mode
|
||||
* @return string The SQL joins for the "select" functions
|
||||
*/
|
||||
private static function constructJoins($uid, $sql_commands, $thread_mode, $user_mode)
|
||||
|
@ -777,7 +789,7 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Update existing item entries
|
||||
*
|
||||
* @param array $fields The fields that are to be changed
|
||||
* @param array $fields The fields that are to be changed
|
||||
* @param array $condition The condition for finding the item entries
|
||||
*
|
||||
* In the future we may have to change permissions as well.
|
||||
|
@ -786,6 +798,7 @@ class Item extends BaseObject
|
|||
* A return value of "0" doesn't mean an error - but that 0 rows had been changed.
|
||||
*
|
||||
* @return integer|boolean number of affected rows - or "false" if there was an error
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function update(array $fields, array $condition)
|
||||
{
|
||||
|
@ -932,8 +945,9 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Delete an item and notify others about it - if it was ours
|
||||
*
|
||||
* @param array $condition The condition for finding the item entries
|
||||
* @param integer $priority Priority for the notification
|
||||
* @param array $condition The condition for finding the item entries
|
||||
* @param integer $priority Priority for the notification
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function delete($condition, $priority = PRIORITY_HIGH)
|
||||
{
|
||||
|
@ -947,8 +961,9 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Delete an item for an user and notify others about it - if it was ours
|
||||
*
|
||||
* @param array $condition The condition for finding the item entries
|
||||
* @param integer $uid User who wants to delete this item
|
||||
* @param array $condition The condition for finding the item entries
|
||||
* @param integer $uid User who wants to delete this item
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function deleteForUser($condition, $uid)
|
||||
{
|
||||
|
@ -973,10 +988,11 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Delete an item and notify others about it - if it was ours
|
||||
*
|
||||
* @param integer $item_id Item ID that should be delete
|
||||
* @param integer $item_id Item ID that should be delete
|
||||
* @param integer $priority Priority for the notification
|
||||
*
|
||||
* @return boolean success
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function deleteById($item_id, $priority = PRIORITY_HIGH)
|
||||
{
|
||||
|
@ -1850,6 +1866,7 @@ class Item extends BaseObject
|
|||
*
|
||||
* @param array $item The item fields that are to be inserted
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function insertActivity(&$item)
|
||||
{
|
||||
|
@ -1896,6 +1913,7 @@ class Item extends BaseObject
|
|||
* @brief Insert a new item content entry
|
||||
*
|
||||
* @param array $item The item fields that are to be inserted
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function insertContent(&$item)
|
||||
{
|
||||
|
@ -1934,8 +1952,10 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Update existing item content entries
|
||||
*
|
||||
* @param array $item The item fields that are to be changed
|
||||
* @param array $item The item fields that are to be changed
|
||||
* @param array $condition The condition for finding the item content entries
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function updateActivity($item, $condition)
|
||||
{
|
||||
|
@ -1960,8 +1980,9 @@ class Item extends BaseObject
|
|||
/**
|
||||
* @brief Update existing item content entries
|
||||
*
|
||||
* @param array $item The item fields that are to be changed
|
||||
* @param array $item The item fields that are to be changed
|
||||
* @param array $condition The condition for finding the item content entries
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function updateContent($item, $condition)
|
||||
{
|
||||
|
@ -1989,6 +2010,7 @@ class Item extends BaseObject
|
|||
*
|
||||
* @param integer $itemid Item ID that should be added
|
||||
* @param string $signed_text Original text (for Diaspora signatures), JSON encoded.
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function distribute($itemid, $signed_text = '')
|
||||
{
|
||||
|
@ -2085,6 +2107,7 @@ class Item extends BaseObject
|
|||
* @param integer $itemid Item ID that should be added
|
||||
* @param array $item The item entry that will be stored
|
||||
* @param integer $uid The user that will receive the item entry
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function storeForUser($itemid, $item, $uid)
|
||||
{
|
||||
|
@ -2132,6 +2155,7 @@ class Item extends BaseObject
|
|||
* It is planned that in the future we will store public item entries only once.
|
||||
*
|
||||
* @param integer $itemid Item ID that should be added
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function addShadow($itemid)
|
||||
{
|
||||
|
@ -2193,6 +2217,7 @@ class Item extends BaseObject
|
|||
* This function does the same like the function above - but for comments
|
||||
*
|
||||
* @param integer $itemid Item ID that should be added
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function addShadowPost($itemid)
|
||||
{
|
||||
|
@ -2249,9 +2274,12 @@ class Item extends BaseObject
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Adds a language specification in a "language" element of given $arr.
|
||||
* Expects "body" element to exist in $arr.
|
||||
*
|
||||
* @param $item
|
||||
* @throws \Text_LanguageDetect_Exception
|
||||
*/
|
||||
private static function addLanguageToItemArray(&$item)
|
||||
{
|
||||
|
@ -2297,10 +2325,11 @@ class Item extends BaseObject
|
|||
/**
|
||||
* generate an unique URI
|
||||
*
|
||||
* @param integer $uid User id
|
||||
* @param string $guid An existing GUID (Otherwise it will be generated)
|
||||
* @param integer $uid User id
|
||||
* @param string $guid An existing GUID (Otherwise it will be generated)
|
||||
*
|
||||
* @return string
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function newURI($uid, $guid = "")
|
||||
{
|
||||
|
@ -2319,6 +2348,7 @@ class Item extends BaseObject
|
|||
* Don't set this value if it isn't from the owner (could be an author that we don't know)
|
||||
*
|
||||
* @param array $arr Contains the just posted item record
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function updateContact($arr)
|
||||
{
|
||||
|
@ -2439,9 +2469,11 @@ class Item extends BaseObject
|
|||
|
||||
/**
|
||||
* This function is only used for the old Friendica app on Android that doesn't like paths with guid
|
||||
*
|
||||
* @param string $guid item guid
|
||||
* @param int $uid user id
|
||||
* @return array with id and nick of the item with the given guid
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getIdAndNickByGuid($guid, $uid = 0)
|
||||
{
|
||||
|
@ -2483,9 +2515,12 @@ class Item extends BaseObject
|
|||
|
||||
/**
|
||||
* look for mention tags and setup a second delivery chain for forum/community posts if appropriate
|
||||
*
|
||||
* @param int $uid
|
||||
* @param int $item_id
|
||||
* @return bool true if item was deleted, else false
|
||||
* @return void true if item was deleted, else false
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
private static function tagDeliver($uid, $item_id)
|
||||
{
|
||||
|
@ -2671,6 +2706,8 @@ class Item extends BaseObject
|
|||
* @param array $item
|
||||
* @param int $cid
|
||||
* @return string
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function fixPrivatePhotos($s, $uid, $item = null, $cid = 0)
|
||||
{
|
||||
|
@ -2928,12 +2965,15 @@ class Item extends BaseObject
|
|||
*
|
||||
* @param string $item_id
|
||||
* @param string $verb
|
||||
* Activity verb. One of
|
||||
* like, unlike, dislike, undislike, attendyes, unattendyes,
|
||||
* attendno, unattendno, attendmaybe, unattendmaybe
|
||||
* @hook 'post_local_end'
|
||||
* array $arr
|
||||
* 'post_id' => ID of posted item
|
||||
* Activity verb. One of
|
||||
* like, unlike, dislike, undislike, attendyes, unattendyes,
|
||||
* attendno, unattendno, attendmaybe, unattendmaybe
|
||||
* @return bool
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
* @hook 'post_local_end'
|
||||
* array $arr
|
||||
* 'post_id' => ID of posted item
|
||||
*/
|
||||
public static function performLike($item_id, $verb)
|
||||
{
|
||||
|
@ -3212,7 +3252,7 @@ class Item extends BaseObject
|
|||
/**
|
||||
* get translated item type
|
||||
*
|
||||
* @param array $itme
|
||||
* @param $item
|
||||
* @return string
|
||||
*/
|
||||
public static function postType($item)
|
||||
|
@ -3238,6 +3278,7 @@ class Item extends BaseObject
|
|||
* @param array $item
|
||||
* @param bool $update
|
||||
*
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @todo Remove reference, simply return "rendered-html" and "rendered-hash"
|
||||
*/
|
||||
public static function putInCache(&$item, $update = false)
|
||||
|
@ -3296,10 +3337,12 @@ class Item extends BaseObject
|
|||
* @param boolean $attach
|
||||
* @param boolean $is_preview
|
||||
* @return string item body html
|
||||
* @hook prepare_body_init item array before any work
|
||||
* @hook prepare_body_content_filter ('item'=>item array, 'filter_reasons'=>string array) before first bbcode to html
|
||||
* @hook prepare_body ('item'=>item array, 'html'=>body string, 'is_preview'=>boolean, 'filter_reasons'=>string array) after first bbcode to html
|
||||
* @hook prepare_body_final ('item'=>item array, 'html'=>body string) after attach icons and blockquote special case handling (spoiler, author)
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
* @hook prepare_body_init item array before any work
|
||||
* @hook prepare_body_content_filter ('item'=>item array, 'filter_reasons'=>string array) before first bbcode to html
|
||||
* @hook prepare_body ('item'=>item array, 'html'=>body string, 'is_preview'=>boolean, 'filter_reasons'=>string array) after first bbcode to html
|
||||
* @hook prepare_body_final ('item'=>item array, 'html'=>body string) after attach icons and blockquote special case handling (spoiler, author)
|
||||
*/
|
||||
public static function prepareBody(array &$item, $attach = false, $is_preview = false)
|
||||
{
|
||||
|
@ -3467,8 +3510,10 @@ class Item extends BaseObject
|
|||
|
||||
/**
|
||||
* get private link for item
|
||||
*
|
||||
* @param array $item
|
||||
* @return boolean|array False if item has not plink, otherwise array('href'=>plink url, 'title'=>translated title)
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getPlink($item)
|
||||
{
|
||||
|
|
|
@ -22,9 +22,10 @@ class ItemContent extends BaseObject
|
|||
* @param int $htmlmode This controls the behavior of the BBCode conversion
|
||||
* @param string $target_network Name of the network where the post should go to.
|
||||
*
|
||||
* @see \Friendica\Content\Text\BBCode::getAttachedData
|
||||
*
|
||||
* @return array Same array structure than \Friendica\Content\Text\BBCode::getAttachedData
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @see \Friendica\Content\Text\BBCode::getAttachedData
|
||||
*
|
||||
*/
|
||||
public static function getPlaintextPost($item, $limit = 0, $includedlinks = false, $htmlmode = 2, $target_network = '')
|
||||
{
|
||||
|
|
|
@ -53,6 +53,7 @@ class ItemDeliveryData
|
|||
*
|
||||
* @param integer $item_id
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function incrementQueueDone($item_id)
|
||||
{
|
||||
|
@ -65,6 +66,7 @@ class ItemDeliveryData
|
|||
* @param integer $item_id
|
||||
* @param array $fields
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function insert($item_id, array $fields)
|
||||
{
|
||||
|
@ -85,6 +87,7 @@ class ItemDeliveryData
|
|||
* @param integer $item_id
|
||||
* @param array $fields
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function update($item_id, array $fields)
|
||||
{
|
||||
|
@ -105,6 +108,7 @@ class ItemDeliveryData
|
|||
*
|
||||
* @param integer $item_id
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function delete($item_id)
|
||||
{
|
||||
|
|
|
@ -17,6 +17,7 @@ class ItemURI extends BaseObject
|
|||
* @param array $fields Item-uri fields
|
||||
*
|
||||
* @return integer item-uri id
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function insert($fields)
|
||||
{
|
||||
|
@ -43,6 +44,7 @@ class ItemURI extends BaseObject
|
|||
* @param string $uri
|
||||
*
|
||||
* @return integer item-uri id
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getIdByURI($uri)
|
||||
{
|
||||
|
|
|
@ -26,6 +26,8 @@ class Mail
|
|||
* @param string $body message body, default empty
|
||||
* @param string $subject message subject, default empty
|
||||
* @param string $replyto reply to
|
||||
* @return int
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function send($recipient = 0, $body = '', $subject = '', $replyto = '')
|
||||
{
|
||||
|
@ -160,6 +162,9 @@ class Mail
|
|||
* @param string $body message body, default empty
|
||||
* @param string $subject message subject, default empty
|
||||
* @param string $replyto reply to, default empty
|
||||
* @return int
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function sendWall($recipient = '', $body = '', $subject = '', $replyto = '')
|
||||
{
|
||||
|
|
|
@ -16,12 +16,13 @@ class OpenWebAuthToken
|
|||
/**
|
||||
* Create an entry in the 'openwebauth-token' table.
|
||||
*
|
||||
* @param string $type Verify type.
|
||||
* @param int $uid The user ID.
|
||||
* @param string $type Verify type.
|
||||
* @param int $uid The user ID.
|
||||
* @param string $token
|
||||
* @param string $meta
|
||||
*
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function create($type, $uid, $token, $meta)
|
||||
{
|
||||
|
@ -38,11 +39,12 @@ class OpenWebAuthToken
|
|||
/**
|
||||
* Get the "meta" field of an entry in the openwebauth-token table.
|
||||
*
|
||||
* @param string $type Verify type.
|
||||
* @param int $uid The user ID.
|
||||
* @param string $type Verify type.
|
||||
* @param int $uid The user ID.
|
||||
* @param string $token
|
||||
*
|
||||
* @return string|boolean The meta enry or false if not found.
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getMeta($type, $uid, $token)
|
||||
{
|
||||
|
@ -62,6 +64,7 @@ class OpenWebAuthToken
|
|||
*
|
||||
* @param string $type Verify type.
|
||||
* @param string $interval SQL compatible time interval
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function purge($type, $interval)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,8 @@ class PermissionSet extends BaseObject
|
|||
* Fetch the id of a given permission set. Generate a new one when needed
|
||||
*
|
||||
* @param array $postarray The array from an item, picture or event post
|
||||
* @return id
|
||||
* @return int id
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function fetchIDForPost(&$postarray)
|
||||
{
|
||||
|
@ -69,6 +70,7 @@ class PermissionSet extends BaseObject
|
|||
* @param array $groups Possibly previously fetched group ids for that contact
|
||||
*
|
||||
* @return array of permission set ids.
|
||||
* @throws \Exception
|
||||
*/
|
||||
|
||||
static public function get($uid, $contact_id, $groups = null)
|
||||
|
|
|
@ -29,13 +29,14 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @brief Select rows from the photo table
|
||||
*
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return boolean|array
|
||||
*
|
||||
* @see \Friendica\Database\DBA::select
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::select
|
||||
*/
|
||||
public static function select(array $fields = [], array $conditions = [], array $params = [])
|
||||
{
|
||||
|
@ -50,13 +51,14 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @brief Retrieve a single record from the photo table
|
||||
*
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
* @param array $fields Array of selected fields, empty for all
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return bool|array
|
||||
*
|
||||
* @see \Friendica\Database\DBA::select
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::select
|
||||
*/
|
||||
public static function selectFirst(array $fields = [], array $conditions = [], array $params = [])
|
||||
{
|
||||
|
@ -70,14 +72,15 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @brief Get photos for user id
|
||||
*
|
||||
* @param integer $uid User id
|
||||
* @param string $resourceid Rescource ID of the photo
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
* @param integer $uid User id
|
||||
* @param string $resourceid Rescource ID of the photo
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return bool|array
|
||||
*
|
||||
* @see \Friendica\Database\DBA::select
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::select
|
||||
*/
|
||||
public static function getPhotosForUser($uid, $resourceid, array $conditions = [], array $params = [])
|
||||
{
|
||||
|
@ -90,15 +93,16 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @brief Get a photo for user id
|
||||
*
|
||||
* @param integer $uid User id
|
||||
* @param string $resourceid Rescource ID of the photo
|
||||
* @param integer $scale Scale of the photo. Defaults to 0
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
* @param integer $uid User id
|
||||
* @param string $resourceid Rescource ID of the photo
|
||||
* @param integer $scale Scale of the photo. Defaults to 0
|
||||
* @param array $conditions Array of fields for conditions
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return bool|array
|
||||
*
|
||||
* @see \Friendica\Database\DBA::select
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::select
|
||||
*/
|
||||
public static function getPhotoForUser($uid, $resourceid, $scale = 0, array $conditions = [], array $params = [])
|
||||
{
|
||||
|
@ -116,10 +120,11 @@ class Photo extends BaseObject
|
|||
* on success, "no sign" image info, if user has no permission,
|
||||
* false if photo does not exists
|
||||
*
|
||||
* @param string $resourceid Rescource ID of the photo
|
||||
* @param integer $scale Scale of the photo. Defaults to 0
|
||||
* @param string $resourceid Rescource ID of the photo
|
||||
* @param integer $scale Scale of the photo. Defaults to 0
|
||||
*
|
||||
* @return boolean|array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getPhoto($resourceid, $scale = 0)
|
||||
{
|
||||
|
@ -145,9 +150,10 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @brief Check if photo with given conditions exists
|
||||
*
|
||||
* @param array $conditions Array of extra conditions
|
||||
* @param array $conditions Array of extra conditions
|
||||
*
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function exists(array $conditions)
|
||||
{
|
||||
|
@ -158,9 +164,11 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @brief Get Image object for given row id. null if row id does not exist
|
||||
*
|
||||
* @param array $photo Photo data. Needs at least 'id', 'type', 'backend-class', 'backend-ref'
|
||||
* @param array $photo Photo data. Needs at least 'id', 'type', 'backend-class', 'backend-ref'
|
||||
*
|
||||
* @return \Friendica\Object\Image
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function getImageForPhoto(array $photo)
|
||||
{
|
||||
|
@ -188,6 +196,7 @@ class Photo extends BaseObject
|
|||
* @brief Return a list of fields that are associated with the photo table
|
||||
*
|
||||
* @return array field list
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function getFields()
|
||||
{
|
||||
|
@ -200,10 +209,11 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @brief Construct a photo array for a system resource image
|
||||
*
|
||||
* @param string $filename Image file name relative to code root
|
||||
* @param string $mimetype Image mime type. Defaults to "image/jpeg"
|
||||
* @param string $filename Image file name relative to code root
|
||||
* @param string $mimetype Image mime type. Defaults to "image/jpeg"
|
||||
*
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function createPhotoForSystemResource($filename, $mimetype = "image/jpeg")
|
||||
{
|
||||
|
@ -236,6 +246,7 @@ class Photo extends BaseObject
|
|||
* @param string $desc Photo caption. optional, default = ""
|
||||
*
|
||||
* @return boolean True on success
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function store(Image $Image, $uid, $cid, $rid, $filename, $album, $scale, $profile = 0, $allow_cid = "", $allow_gid = "", $deny_cid = "", $deny_gid = "", $desc = "")
|
||||
{
|
||||
|
@ -310,12 +321,13 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @brief Delete info from table and data from storage
|
||||
*
|
||||
* @param array $conditions Field condition(s)
|
||||
* @param array $options Options array, Optional
|
||||
* @param array $conditions Field condition(s)
|
||||
* @param array $options Options array, Optional
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @see \Friendica\Database\DBA::delete
|
||||
* @throws \Exception
|
||||
* @see \Friendica\Database\DBA::delete
|
||||
*/
|
||||
public static function delete(array $conditions, array $options = [])
|
||||
{
|
||||
|
@ -342,7 +354,8 @@ class Photo extends BaseObject
|
|||
*
|
||||
* @return boolean Was the update successfull?
|
||||
*
|
||||
* @see \Friendica\Database\DBA::update
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @see \Friendica\Database\DBA::update
|
||||
*/
|
||||
public static function update($fields, $conditions, Image $img = null, array $old_fields = [])
|
||||
{
|
||||
|
@ -372,6 +385,8 @@ class Photo extends BaseObject
|
|||
* @param integer $cid contact id
|
||||
* @param boolean $quit_on_error optional, default false
|
||||
* @return array
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function importProfilePhoto($image_url, $uid, $cid, $quit_on_error = false)
|
||||
{
|
||||
|
@ -508,6 +523,7 @@ class Photo extends BaseObject
|
|||
* @param bool $update Update the cache
|
||||
*
|
||||
* @return array Returns array of the photo albums
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function getAlbums($uid, $update = false)
|
||||
{
|
||||
|
@ -545,6 +561,7 @@ class Photo extends BaseObject
|
|||
/**
|
||||
* @param int $uid User id of the photos
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function clearAlbumCache($uid)
|
||||
{
|
||||
|
@ -556,6 +573,7 @@ class Photo extends BaseObject
|
|||
* Generate a unique photo ID.
|
||||
*
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function newResource()
|
||||
{
|
||||
|
|
|
@ -19,6 +19,7 @@ class Process extends BaseObject
|
|||
* @param string $command
|
||||
* @param string $pid
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function insert($command, $pid = null)
|
||||
{
|
||||
|
@ -44,6 +45,7 @@ class Process extends BaseObject
|
|||
*
|
||||
* @param string $pid
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function deleteByPid($pid = null)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ class Profile
|
|||
* @param integer User ID
|
||||
*
|
||||
* @return array Profile data
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getByUID($uid)
|
||||
{
|
||||
|
@ -102,6 +103,8 @@ class Profile
|
|||
* @param int $profile int
|
||||
* @param array $profiledata array
|
||||
* @param boolean $show_connect Show connect link
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function load(App $a, $nickname, $profile = 0, array $profiledata = [], $show_connect = true)
|
||||
{
|
||||
|
@ -206,10 +209,11 @@ class Profile
|
|||
* Includes all available profile data
|
||||
*
|
||||
* @brief Get all profile data of a local user
|
||||
* @param string $nickname nick
|
||||
* @param int $uid uid
|
||||
* @param int $profile_id ID of the profile
|
||||
* @param string $nickname nick
|
||||
* @param int $uid uid
|
||||
* @param int $profile_id ID of the profile
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getByNickname($nickname, $uid = 0, $profile_id = 0)
|
||||
{
|
||||
|
@ -265,13 +269,15 @@ class Profile
|
|||
* because of all the conditional logic.
|
||||
*
|
||||
* @brief Formats a profile for display in the sidebar.
|
||||
* @param array $profile
|
||||
* @param int $block
|
||||
* @param array $profile
|
||||
* @param int $block
|
||||
* @param boolean $show_connect Show connect link
|
||||
*
|
||||
* @return string HTML sidebar module
|
||||
*
|
||||
* @note Returns empty string if passed $profile is wrong type or not populated
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
* @note Returns empty string if passed $profile is wrong type or not populated
|
||||
*
|
||||
* @hooks 'profile_sidebar_enter'
|
||||
* array $profile - profile data
|
||||
|
@ -1022,6 +1028,8 @@ class Profile
|
|||
* Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/channel.php
|
||||
*
|
||||
* @param App $a Application instance.
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function zrlInit(App $a)
|
||||
{
|
||||
|
@ -1091,6 +1099,8 @@ class Profile
|
|||
* Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/zid.php
|
||||
*
|
||||
* @param string $token
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function openWebAuthInit($token)
|
||||
{
|
||||
|
@ -1184,6 +1194,7 @@ class Profile
|
|||
* @brief Get the user ID of the page owner
|
||||
* @return int user ID
|
||||
*
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @note Returns local_user instead of user ID if "always_my_theme" is set to true
|
||||
*/
|
||||
public static function getThemeUid(App $a)
|
||||
|
@ -1208,11 +1219,12 @@ class Profile
|
|||
}
|
||||
|
||||
/**
|
||||
* Stip query parameter from a string.
|
||||
*
|
||||
* @param string $s The input string.
|
||||
* @return string The query parameter.
|
||||
*/
|
||||
* Strip query parameter from a string.
|
||||
*
|
||||
* @param string $s The input string.
|
||||
* @param $param
|
||||
* @return string The query parameter.
|
||||
*/
|
||||
public static function stripQueryParam($s, $param)
|
||||
{
|
||||
return preg_replace('/[\?&]' . $param . '=(.*?)(&|$)/ism', '$2', $s);
|
||||
|
|
|
@ -14,8 +14,9 @@ class PushSubscriber
|
|||
/**
|
||||
* @brief Send subscription notifications for the given user
|
||||
*
|
||||
* @param integer $uid User ID
|
||||
* @param string $priority Priority for push workers
|
||||
* @param integer $uid User ID
|
||||
* @param int $default_priority
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function publishFeed($uid, $default_priority = PRIORITY_HIGH)
|
||||
{
|
||||
|
@ -28,7 +29,8 @@ class PushSubscriber
|
|||
/**
|
||||
* @brief start workers to transmit the feed data
|
||||
*
|
||||
* @param string $priority Priority for push workers
|
||||
* @param int $default_priority
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function requeue($default_priority = PRIORITY_HIGH)
|
||||
{
|
||||
|
@ -60,6 +62,7 @@ class PushSubscriber
|
|||
* @param string $hub_callback Callback address
|
||||
* @param string $hub_topic Feed topic
|
||||
* @param string $hub_secret Subscription secret
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function renew($uid, $nick, $subscribe, $hub_callback, $hub_topic, $hub_secret)
|
||||
{
|
||||
|
@ -98,6 +101,7 @@ class PushSubscriber
|
|||
* @brief Delay the push subscriber
|
||||
*
|
||||
* @param integer $id Subscriber ID
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function delay($id)
|
||||
{
|
||||
|
@ -135,7 +139,8 @@ class PushSubscriber
|
|||
* @brief Reset the push subscriber
|
||||
*
|
||||
* @param integer $id Subscriber ID
|
||||
* @param date $last_update Date of last transmitted item
|
||||
* @param string $last_update Date of last transmitted item
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function reset($id, $last_update)
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@ class Queue
|
|||
{
|
||||
/**
|
||||
* @param string $id id
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function updateTime($id)
|
||||
{
|
||||
|
@ -37,6 +38,7 @@ class Queue
|
|||
|
||||
/**
|
||||
* @param string $id id
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function removeItem($id)
|
||||
{
|
||||
|
@ -78,6 +80,8 @@ class Queue
|
|||
* @param string $network network
|
||||
* @param string $msg message
|
||||
* @param boolean $batch batch, default false
|
||||
* @param string $guid
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function add($cid, $network, $msg, $batch = false, $guid = '')
|
||||
{
|
||||
|
|
|
@ -20,6 +20,7 @@ class Register
|
|||
* Return the list of pending registrations
|
||||
*
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getPending()
|
||||
{
|
||||
|
@ -37,6 +38,7 @@ class Register
|
|||
* Returns the pending registration count
|
||||
*
|
||||
* @return int
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getPendingCount()
|
||||
{
|
||||
|
@ -54,6 +56,7 @@ class Register
|
|||
*
|
||||
* @param string $hash
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function getByHash($hash)
|
||||
{
|
||||
|
@ -63,8 +66,9 @@ class Register
|
|||
/**
|
||||
* Returns true if a register record exists with the provided hash
|
||||
*
|
||||
* @param string $hash
|
||||
* @param string $hash
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function existsByHash($hash)
|
||||
{
|
||||
|
@ -75,6 +79,7 @@ class Register
|
|||
* Creates a register record for an invitation and returns the auto-generated code for it
|
||||
*
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function createForInvitation()
|
||||
{
|
||||
|
@ -98,6 +103,7 @@ class Register
|
|||
* @param string $language The registration language
|
||||
* @param string $note An additional message from the user
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function createForApproval($uid, $language, $note = '')
|
||||
{
|
||||
|
@ -122,8 +128,9 @@ class Register
|
|||
/**
|
||||
* Deletes a register record by the provided hash and returns the success of the database deletion
|
||||
*
|
||||
* @param string $hash
|
||||
* @param string $hash
|
||||
* @return boolean
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function deleteByHash($hash)
|
||||
{
|
||||
|
|
|
@ -49,7 +49,8 @@ class Filesystem implements IStorage
|
|||
|
||||
/**
|
||||
* @brief Create dirctory tree to store file, with .htaccess and index.html files
|
||||
* @param string $file Path and filename
|
||||
* @param string $file Path and filename
|
||||
* @throws StorageException
|
||||
*/
|
||||
private static function createFoldersForFile($file)
|
||||
{
|
||||
|
|
|
@ -192,7 +192,9 @@ class Term
|
|||
|
||||
/**
|
||||
* @param integer $itemid item id
|
||||
* @param $files
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function insertFromFileFieldByItemId($itemid, $files)
|
||||
{
|
||||
|
@ -241,6 +243,8 @@ class Term
|
|||
*
|
||||
* @param array $item
|
||||
* @return array
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function populateTagsFromItem(&$item)
|
||||
{
|
||||
|
@ -291,8 +295,10 @@ class Term
|
|||
|
||||
/**
|
||||
* Delete all tags from an item
|
||||
*
|
||||
* @param int itemid - choose from which item the tags will be removed
|
||||
* @param array type - items type. default is [TERM_HASHTAG, TERM_MENTION]
|
||||
* @param array $type
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function deleteByItemId($itemid, $type = [TERM_HASHTAG, TERM_MENTION])
|
||||
{
|
||||
|
|
|
@ -34,6 +34,7 @@ class User
|
|||
*
|
||||
* @param integer $uid
|
||||
* @return boolean
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function exists($uid)
|
||||
{
|
||||
|
@ -43,6 +44,7 @@ class User
|
|||
/**
|
||||
* @param integer $uid
|
||||
* @return array|boolean User record if it exists, false otherwise
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getById($uid)
|
||||
{
|
||||
|
@ -55,6 +57,7 @@ class User
|
|||
* @param string $url
|
||||
*
|
||||
* @return integer user id
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getIdForURL($url)
|
||||
{
|
||||
|
@ -71,6 +74,7 @@ class User
|
|||
*
|
||||
* @param int $uid
|
||||
* @return boolean|array
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getOwnerDataById($uid) {
|
||||
$r = DBA::fetchFirst("SELECT
|
||||
|
@ -115,6 +119,7 @@ class User
|
|||
*
|
||||
* @param int $nick
|
||||
* @return boolean|array
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function getOwnerDataByNick($nick)
|
||||
{
|
||||
|
@ -134,6 +139,7 @@ class User
|
|||
* @param string $network network name
|
||||
*
|
||||
* @return int group id
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function getDefaultGroup($uid, $network = '')
|
||||
{
|
||||
|
@ -364,6 +370,7 @@ class User
|
|||
* @param int $uid
|
||||
* @param string $pasword_hashed
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
private static function updatePasswordHashed($uid, $pasword_hashed)
|
||||
{
|
||||
|
@ -385,6 +392,7 @@ class User
|
|||
*
|
||||
* @param string $nickname The nickname that should be checked
|
||||
* @return boolean True is the nickname is blocked on the node
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function isNicknameBlocked($nickname)
|
||||
{
|
||||
|
@ -422,6 +430,7 @@ class User
|
|||
* @return array
|
||||
* @throws \ErrorException
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function create(array $data)
|
||||
|
@ -807,7 +816,8 @@ class User
|
|||
|
||||
/**
|
||||
* @param object $uid user to remove
|
||||
* @return void
|
||||
* @return bool
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function remove($uid)
|
||||
{
|
||||
|
@ -848,18 +858,19 @@ class User
|
|||
* @return array All identities for this user
|
||||
*
|
||||
* Example for a return:
|
||||
* [
|
||||
* [
|
||||
* 'uid' => 1,
|
||||
* 'username' => 'maxmuster',
|
||||
* 'nickname' => 'Max Mustermann'
|
||||
* ],
|
||||
* [
|
||||
* 'uid' => 2,
|
||||
* 'username' => 'johndoe',
|
||||
* 'nickname' => 'John Doe'
|
||||
* ]
|
||||
* ]
|
||||
* [
|
||||
* [
|
||||
* 'uid' => 1,
|
||||
* 'username' => 'maxmuster',
|
||||
* 'nickname' => 'Max Mustermann'
|
||||
* ],
|
||||
* [
|
||||
* 'uid' => 2,
|
||||
* 'username' => 'johndoe',
|
||||
* 'nickname' => 'John Doe'
|
||||
* ]
|
||||
* ]
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function identities($uid)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue