Overview

Packages

  • ClipIt
    • clipit
      • api
    • urjc
      • backend
  • Elgg
    • Core
      • Access
      • Authentication
      • Cache
      • Caches
      • Core
      • DataMode
        • Site
      • DataModel
        • Annotations
        • Entities
        • Extender
        • File
        • Importable
        • Loggable
        • Notable
        • Object
        • User
      • DataStorage
      • Exception
      • Exceptions
        • Stub
      • FileStore
        • Disk
      • Groups
      • Helpers
      • HMAC
      • Memcache
      • Metadata
      • Navigation
      • ODD
      • Output
      • Plugins
        • Settings
      • Sessions
      • SocialModel
        • Friendable
        • Locatable
      • WebServicesAPI
      • Widgets
      • XML
      • XMLRPC
    • Exceptions
      • Stub
  • None
  • PHP

Classes

  • UBCollection
  • UBEvent
  • UBFile
  • UBItem
  • UBMessage
  • UBSite
  • UBUser
  • Overview
  • Package
  • Class
  • Tree

Class UBMessage

<Class Description>

UBItem
Extended by UBMessage

Direct known subclasses

ClipitChat, ClipitComment, ClipitPost
Package: ClipIt\urjc\backend
License: Affero General Public License v3
Author: Pablo LlinĂ¡s Arnaiz <pebs74@gmail.com>, URJC JuxtaLearn Team
Located at UBMessage.php
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

UBItem::copy_from_elgg()
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

UBItem::copy_to_elgg()
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

UBItem::save()
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

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

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

InvalidParameterException
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
# unread_by_destination( mixed $destination_array, mixed $user_id, mixed $recursive = false )
public static
# unread_by_sender( mixed $sender_array, mixed $user_id )
Methods inherited from UBItem
__construct(), count_all(), create(), create_clone(), delete_all(), delete_by_id(), get_all(), get_all_parents(), get_by_id(), get_by_owner(), get_clone_tree(), get_cloned_from(), get_clones(), get_events(), get_from_search(), get_properties(), link_parent_clone(), list_properties(), set_properties(), sort_by_date(), sort_by_date_inv(), sort_by_name(), sort_by_name_inv(), sort_numbers(), sort_numbers_inv(), unlink_from_clones(), unlink_from_parent()
Constants summary
string REL_MESSAGE_DESTINATION "UBMessage-destination"
#
string REL_MESSAGE_FILE "UBMessage-UBFile"
#
string REL_MESSAGE_USER "UBMessage-UBUser"
#
Constants inherited from UBItem
REL_PARENT_CLONE, SUBTYPE, TYPE
Properties summary
public integer $destination 0
#
public array $file_array array()
#
public array $read_array array()
#
Properties inherited from UBItem
$clone_array, $cloned_from, $description, $id, $name, $owner_id, $time_created, $url
API documentation generated by ApiGen 2.8.0