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 UBItem

<Class Description>

Direct known subclasses

ClipitActivity, ClipitExample, ClipitQuizResult, ClipitRating, ClipitRemoteSite, ClipitRemoteTrickyTopic, ClipitRemoteVideo, ClipitResource, ClipitTag, ClipitTagRating, ClipitTask, ClipitTrickyTopic, ClipitExampleType, UBFile, UBMessage, UBUser, ClipitGroup, ClipitLA, ClipitLabel, ClipitPerformanceItem, ClipitPerformanceRating, ClipitQuiz, ClipitQuizQuestion

Indirect known subclasses

ClipitChat, ClipitComment, ClipitFile, ClipitPost, ClipitStoryboard, ClipitUser, ClipitVideo
Package: ClipIt\urjc\backend
License: Affero General Public License v3
Author: Pablo LlinĂ¡s Arnaiz <pebs74@gmail.com>, URJC JuxtaLearn Team
Located at UBItem.php
Methods summary
public
# __construct( integer $id = null, ElggObject|ElggEntity $elgg_object = null )

Constructor

Constructor

Parameters

$id
integer
$id If !null, load instance.
$elgg_object
ElggObject|ElggEntity
$elgg_object Object to load instance from (optional)

Throws

APIException
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.
public static integer
# get_cloned_from( integer $id, boolean $recursive = false )

Get the parent Item ID for an Item.

Get the parent Item ID for an Item.

Parameters

$id
integer
$id Item from which to return parent
$recursive
boolean
$recursive Whether to look for parent recursively

Returns

integer
Parent ID
public static array[static]|array[int]
# get_all_parents( string $order_by = "", boolean $ascending = true, boolean|false $id_only = false )

Get all parent "master" items (which are not cloned)

Get all parent "master" items (which are not cloned)

Parameters

$order_by
string
$order_by forwarded to get_all (see get_all)
$ascending
boolean
$ascending forwarded to get_all (see get_all)
$id_only
boolean|false
$id_only Whether to return only IDs

Returns

array[static]|array[int]
Array of parent objects from class
public static int[]
# get_clones( integer $id, boolean $recursive = false )

Get an ID array of all cloned Items from a specified one.

Get an ID array of all cloned Items from a specified one.

Parameters

$id
integer
$id Item from which to return clones
$recursive
boolean
$recursive Whether to look for clones recursively

Returns

int[]
Array of Item IDs
public static integer|boolean
# create( array $prop_value_array )

Create a new instance of this class, and assign values to its properties.

Create a new instance of this class, and assign values to its properties.

Parameters

$prop_value_array
array
$prop_value_array Array of [property]=>value pairs to set into the new instance

Returns

integer|boolean
Returns instance Id if correct, or false if error
public static integer|boolean
# set_properties( integer $id, array $prop_value_array )

Sets values to specified properties of an Item

Sets values to specified properties of an Item

Parameters

$id
integer
$id Id of Item to set property values
$prop_value_array
array
$prop_value_array Array of property=>value pairs to set into the Item

Returns

integer|boolean
Returns Id of Item if correct, or false if error

Throws

InvalidParameterException
public static array
# list_properties( )

Lists the properties contained in this object

Lists the properties contained in this object

Returns

array
Array of properties with type and default value
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 id of saved instance, or false if error.
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
public static boolean|integer
# create_clone( integer $id, boolean $linked = true, boolean $keep_owner = false )

Clone the specified Item, including all of its properties.

Clone the specified Item, including all of its properties.

Parameters

$id
integer
$id Item id from which to create a clone.
$linked
boolean
$linked Selects whether the clone will be linked to the parent object.
$keep_owner
boolean
$keep_owner Selects whether the clone will keep the parent item's owner (default: no)

Returns

boolean|integer
Id of the new clone Item, false in case of error.
public static array|boolean
# get_properties( integer $id, array $prop_array = null )

Get specified property values for an Item

Get specified property values for an Item

Parameters

$id
integer
$id Id of instance to get properties from
$prop_array
array
$prop_array Array of property names to get values from

Returns

array|boolean
Returns an array of property=>value pairs, or false if error

Throws

InvalidParameterException
public static boolean
# link_parent_clone( integer $id_parent, integer $id_clone )

Links two entities as parent and clone

Links two entities as parent and clone

Parameters

$id_parent
integer
$id_parent ID of parent entity
$id_clone
integer
$id_clone IF of clone entity

Returns

boolean
true if OK
public static boolean
# unlink_from_parent( integer $id )

Unlinks an entity from its parent

Unlinks an entity from its parent

Parameters

$id
integer
$id ID of entity

Returns

boolean
returns true if OK
public static boolean
# unlink_from_clones( integer $id )

Unlinks an entity from its clones

Unlinks an entity from its clones

Parameters

$id
integer
$id ID of entity

Returns

boolean
returns true if OK]
public static int[]
# get_clone_tree( integer|null $id = null )

Get an array with the full clone list of the clone tree an item belongs to

Get an array with the full clone list of the clone tree an item belongs to

Parameters

$id
integer|null
$id ID of Item (if non set, return all trees)

Returns

int[]
Array of item IDs

Throws

InvalidParameterException
public static boolean
# delete_all( )

Delete All Items for this class.

Delete All Items for this class.

Returns

boolean
Returns true if correct, or false if error
public static
# count_all( )
public static static[]|int[]
# get_all( integer $limit = 0, integer $offset = 0, string $order_by = "", boolean $ascending = true, boolean $id_only = false )

Get all Object instances of this TYPE and SUBTYPE from the system, optionally only a specified property.

Get all Object instances of this TYPE and SUBTYPE from the system, optionally only a specified property.

Parameters

$limit
integer
$limit Number of results to show, default= 0 [no limit] (optional)
$offset
integer
$offset Offset from where to show results, default=0 [from the begining] (optional)
$order_by
string
$order_by Default = "" == time_created desc (newest first)
$ascending
boolean
$ascending Default = true (ascending order)
$id_only
boolean
$id_only Whether to only return IDs, or return whole objects (default: false) will be done if it is set to true.

Returns

static[]|int[]
Returns an array of Objects, or Object IDs if id_only = true
public static boolean
# delete_by_id( array $id_array )

Delete Items given their Id.

Delete Items given their Id.

Parameters

$id_array
array
$id_array List of Item Ids to delete

Returns

boolean
Returns true if correct, or false if error
public static static[]
# get_by_id( array $id_array, integer $limit = 0, integer $offset = 0, string $order_by = "", boolean $ascending = true )

Get Objects with id contained in a given list.

Get Objects with id contained in a given list.

Parameters

$id_array
array
$id_array Array of item IDs to get
$limit
integer
$limit (optional) limit of items to get
$offset
integer
$offset (optional) offset of items to get
$order_by
string
$order_by (optional) order by a certain property
$ascending
boolean
$ascending (optional) order by ascending (default) or descending

Returns

static[]
array of UBItems filtered by the parameters given
public static static[]
# get_by_owner( array $owner_array = null, integer $limit = 0, integer $offset = 0, string $order_by = "", boolean $ascending = true )

Get Items with Owner Id contained in a given list.

Get Items with Owner Id contained in a given list.

Parameters

$owner_array
array
$owner_array Array of Owner Ids
$limit
integer
$limit (optional) Number of Items to return, default 0 = all
$offset
integer
$offset (optional) offset of items to get
$order_by
string
$order_by (optional) order by a certain property
$ascending
boolean
$ascending (optional) order by ascending (default) or descending

Returns

static[]
Returns an array of Items
public static array
# get_events( integer $offset = 0, integer $limit = 10 )

Get all system events filtered by the class TYPE and SUBTYPE.

Get all system events filtered by the class TYPE and SUBTYPE.

Parameters

$offset
integer
$offset Skip the first $offset events
$limit
integer
$limit Return at most $limit events

Returns

array
Array of system events
public static static[]
# get_from_search( string $search_string, boolean $name_only = false, boolean $strict = false, integer $limit = 0, integer $offset = 0 )

Get all objects which match a $search_string

Get all objects which match a $search_string

Parameters

$search_string
string
$search_string String for searching matching objects
$name_only
boolean
$name_only Whether to look only in the name property, default false.
$strict
boolean
$strict Whether to match the $search_string exactly, including case, or only partially.
$limit
integer
$offset The offset of the returned array
$offset
integer
$limit The limit of the returned array

Returns

static[]
Returns an array of matched objects
public static integer
# sort_by_date( static $i1, static $i2 )

Sort by Date, oldest to newest.

Sort by Date, oldest to newest.

Parameters

$i1
static
$i1
$i2
static
$i2

Returns

integer
Returns 0 if equal, -1 if i1 before i2, 1 if i1 after i2.
public static integer
# sort_by_date_inv( static $i1, static $i2 )

Sort by Date Inverse order, newest to oldest.

Sort by Date Inverse order, newest to oldest.

Parameters

$i1
static
$i1
$i2
static
$i2

Returns

integer
Returns 0 if equal, -1 if i1 before i2, 1 if i1 after i2.
public static integer
# sort_by_name( static $i1, static $i2 )

Sort by Name, in alphabetical order.

Sort by Name, in alphabetical order.

Parameters

$i1
static
$i1
$i2
static
$i2

Returns

integer
Returns 0 if equal, -1 if i1 before i2, 1 if i1 after i2.
public static integer
# sort_by_name_inv( static $i1, static $i2 )

Sort by Name, in inverse alphabetical order.

Sort by Name, in inverse alphabetical order.

Parameters

$i1
static
$i1
$i2
static
$i2

Returns

integer
Returns 0 if equal, -1 if i1 before i2, 1 if i1 after i2.
public static integer
# sort_numbers( float $i1, float $i2 )

Sort numbers, in increasing order.

Sort numbers, in increasing order.

Parameters

$i1
float
$i1
$i2
float
$i2

Returns

integer
Returns 0 if equal, -1 if i1 before i2, 1 if i1 after i2.
public static integer
# sort_numbers_inv( float $i1, float $i2 )

Sort numbers, in decreasing order.

Sort numbers, in decreasing order.

Parameters

$i1
float
$i1
$i2
float
$i2

Returns

integer
Returns 0 if equal, -1 if i1 before i2, 1 if i1 after i2.
Constants summary
string TYPE "object"
#

Const

string Elgg entity TYPE for this class
string SUBTYPE "UBItem"
#

Const

string Elgg entity SUBTYPE for this class
string REL_PARENT_CLONE "parent-clone"
#

Const

string Clone-Parent relationship name
Properties summary
public integer $id 0
#

Unique Id of this instance

Unique Id of this instance

public string $name ""
#

Name of this instance

Name of this instance

public string $description ""
#

Description of this instance

Description of this instance

public string $url ""
#

URL of the instance

URL of the instance

public integer $owner_id 0
#

Unique Id of the owner/creator of this instance

Unique Id of the owner/creator of this instance

public integer $time_created 0
#

Timestamp when this Item was created

Timestamp when this Item was created

public integer $cloned_from 0
#

Origin object id, in case this object was cloned. If not = 0.

Origin object id, in case this object was cloned. If not = 0.

public array $clone_array array()
#

Object clone ids.

Object clone ids.

API documentation generated by ApiGen 2.8.0