Methods summary
protected
|
#
copy_from_elgg( ElggEntity $elgg_entity )
Loads object parameters stored in Elgg
Loads object parameters stored in Elgg
Parameters
- $elgg_entity
ElggEntity
$elgg_entity Elgg Object to load parameters from.
Overrides
|
protected
|
#
copy_to_elgg( ElggEntity $elgg_entity )
Copy $this object parameters into an Elgg entity.
Copy $this object parameters into an Elgg entity.
Parameters
- $elgg_entity
ElggEntity
$elgg_entity Elgg object instance to save $this to
Overrides
|
protected
boolean|integer
|
#
save( boolean $double_save = false )
Saves this instance to the system.
Saves this instance to the system.
Parameters
- $double_save
boolean $double_save if $double_save is true, this object is saved twice to ensure that
all properties are updated properly. E.g. the time created property can only
beset on ElggObjects during an update. Defaults to false!
Returns
boolean|integer Returns the Id of the saved instance, or false if error
Overrides
|
public static
static[]
|
#
get_by_destination( array $destination_array, integer $limit = 0, integer $offset = 0, boolean $count_only = false, string $order_by = "", boolean $ascending = true )
Get Messages by Destination
Get Messages by Destination
Parameters
- $destination_array
array $destination_array Array of Destination IDs
- $limit
integer $offset (default = 0 : begining)
- $offset
integer $limit (default = 0 : none)
- $count_only
boolean $count_only (default = false : no)
- $order_by
string $order_by property to order results by
- $ascending
boolean $ascending Whether to order ascending (true) or descending (false)
Returns
static[] Array of Messages
|
public static
static[]
|
#
get_by_sender( array $sender_array )
Get Messages by Sender
Parameters
- $sender_array
array $sender_array Array of Sender IDs
Returns
static[] Array of Messages
|
public static
integer|null
|
#
get_destination( integer $id )
Get the Destination of a Message
Get the Destination of a Message
Parameters
- $id
integer $id ID of Message
Returns
integer|null ID of Destination or null if error
|
public static
boolean
|
#
set_destination( integer $id, integer $destination_id )
Set the Destination of a Message
Set the Destination of a Message
Parameters
- $id
integer $id Id of the Message
- $destination_id
integer $destination_id ID of the Destination
Returns
boolean True if OK, false if error
|
public static
integer
|
#
get_sender( integer $id )
Get Sender of a Message
Parameters
- $id
integer $id ID of the Message
Returns
integer ID of the Sender
|
public static
boolean
|
#
add_files( integer $id, array $file_array )
Add Files attached to a Message
Add Files attached to a Message
Parameters
- $id
integer $id ID of the Message
- $file_array
array $file_array Array of File IDs
Returns
boolean True if OK, false if error
|
public static
boolean
|
#
set_files( integer $id, array $file_array )
Set Files attached to a Message
Set Files attached to a Message
Parameters
- $id
integer $id ID of the Message
- $file_array
array $file_array Array of File IDs
Returns
boolean True if OK, false if error
|
public static
boolean
|
#
remove_files( integer $id, array $file_array )
Remove Files attached to a Message
Remove Files attached to a Message
Parameters
- $id
integer $id ID of the Message
- $file_array
array $file_array Array of File IDs
Returns
boolean True if OK, false if error
|
public static
static[]
|
#
get_files( integer $id )
Get Files attached to a Message
Get Files attached to a Message
Parameters
- $id
integer $id ID of the Message
Returns
static[] Array of File IDs
|
public static
boolean
|
#
add_read_array( integer $id, array $read_array )
Add Read Array for a Message
Add Read Array for a Message
Parameters
- $id
integer $id ID of the Message
- $read_array
array $read_array Array of User IDs who have read the Message
Returns
boolean True if OK, false if error
|
public static
boolean
|
#
set_read_array( integer $id, array $read_array )
Set Read Array for a Message
Set Read Array for a Message
Parameters
- $id
integer $id ID of the Message
- $read_array
array $read_array Array of User IDs who have read the Message
Returns
boolean True if OK, false if error
|
public static
boolean
|
#
remove_read_array( integer $id, array $read_array )
Remove Read Array for a Message
Remove Read Array for a Message
Parameters
- $id
integer $id ID of the Message
- $read_array
array $read_array Array of User IDs who have read the Message
Returns
boolean True if OK, false if error
|
public static
static[]
|
#
get_read_array( integer $id )
Get Read Array for a Message
Get Read Array for a Message
Parameters
- $id
integer $id ID of the Message
Returns
static[] Array of File IDs
|
public static
static[]
|
#
get_read_status( integer $id, null|array $user_array = null )
Get a list of Users who have Read a Message, or optionally whether certain
Users have read it
Get a list of Users who have Read a Message, or optionally whether certain
Users have read it
Parameters
- $id
integer $id ID of the Message
- $user_array
null|array $user_array List of User IDs - optional
Returns
static[] Array with key => value: user_id => read_status, where read_status is bool
|
public static
boolean|integer
|
#
set_read_status( integer $id, boolean $read_value, array $user_array )
Set the Read status for a Message
Set the Read status for a Message
Parameters
- $id
integer $id ID of Message
- $read_value
boolean $read_value Read status value: true = read, false = unread
- $user_array
array $user_array Array of User IDs
Returns
boolean|integer ID of Message if Ok, false if error
Throws
|
public static
array
|
#
count_by_destination( array $destination_array, boolean $recursive = false )
Count the number os Messages for each Destination specified
Count the number os Messages for each Destination specified
Parameters
- $destination_array
array $destination_array List of Destination IDs
- $recursive
boolean $recursive Whether to recurse
Returns
array Returns array of destination => message_count elements.
|
public static
array
|
#
count_by_sender( array $sender_array )
Count number of Messages sent by Sender
Count number of Messages sent by Sender
Parameters
- $sender_array
array $sender_array Array of User IDs
Returns
array Array of sender => message_count elements
|
public static
|
|
public static
|
|