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

  • ClipitActivity
  • ClipitChat
  • ClipitComment
  • ClipitEvent
  • ClipitExample
  • ClipitFile
  • ClipitGroup
  • ClipitLA
  • ClipitLabel
  • ClipitPerformanceItem
  • ClipitPerformanceRating
  • ClipitPost
  • ClipitQuiz
  • ClipitQuizQuestion
  • ClipitQuizResult
  • ClipitRating
  • ClipitRemoteTrickyTopic
  • ClipitRemoteVideo
  • ClipitResource
  • ClipitSite
  • ClipitStoryboard
  • ClipitTag
  • ClipitTagRating
  • ClipitTask
  • ClipitTrickyTopic
  • ClipitUser
  • ClipitVideo
  • Overview
  • Package
  • Class
  • Tree

Class ClipitResource

An extensible class which holds common functionality and properties for Resource objects such as Videos or Storyboards.

UBItem
Extended by ClipitResource

Direct known subclasses

ClipitStoryboard, ClipitVideo
Abstract
Package: ClipIt\clipit\api
License: Affero General Public License v3
Author: Pablo LlinĂ¡s Arnaiz <pebs74@gmail.com>, URJC JuxtaLearn Team
Located at ClipitResource.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 boolean
# add_read_array( integer $id, array $read_array )

Add Read Array for a Resource

Add Read Array for a Resource

Parameters

$id
integer
$id ID of the Resource
$read_array
array
$read_array Array of User IDs who have read the Resource

Returns

boolean
True if OK, false if error
public static boolean
# set_read_array( integer $id, array $read_array )

Set Read Array for a Resource

Set Read Array for a Resource

Parameters

$id
integer
$id ID of the Resource
$read_array
array
$read_array Array of User IDs who have read the Resource

Returns

boolean
True if OK, false if error
public static boolean
# remove_read_array( integer $id, array $read_array )

Remove Read Array for a Resource

Remove Read Array for a Resource

Parameters

$id
integer
$id ID of the Resource
$read_array
array
$read_array Array of User IDs who have read the Resource

Returns

boolean
True if OK, false if error
public static static[]
# get_read_array( integer $id )

Get Read Array for a Resource

Get Read Array for a Resource

Parameters

$id
integer
$id ID of the Resource

Returns

static[]
Array of Resource IDs
public static
# update_average_ratings( mixed $id )
public static
# get_by_tags( mixed $tag_array )
public static array|boolean
# get_tags( integer $id )

Get all Tags from a Resource

Get all Tags from a Resource

Parameters

$id
integer
$id Id of the Resource to get Tags from

Returns

array|boolean
Returns an array of Tag IDs, or false if error
public static
# add_performance_items( mixed $id, mixed $performance_item_array )
public static
# set_performance_items( mixed $id, mixed $performance_item_array )
public static
# remove_performance_items( mixed $id, mixed $performance_item_array )
public static
# get_performance_items( mixed $id )
public static
# get_by_labels( mixed $label_array )
public static array|boolean
# get_labels( integer $id )

Get Label Ids from a Resource.

Get Label Ids from a Resource.

Parameters

$id
integer
$id Id of the Resource to get Labels from.

Returns

array|boolean
Returns array of Label Ids, or false if error.
public static boolean
# add_labels( integer $id, array $label_array )

Add Labels to a Resource.

Add Labels to a Resource.

Parameters

$id
integer
$id Id of the Resource to add Labels to.
$label_array
array
$label_array Array of Label Ids to add to the Resource.

Returns

boolean
Returns true if added correctly, or false if error.
public static boolean
# remove_labels( integer $id, array $label_array )

Remove Labels from a Resource.

Remove Labels from a Resource.

Parameters

$id
integer
$id Id of the Resource to remove Labels from.
$label_array
array
$label_array Array of Label Ids to remove from the Resource.

Returns

boolean
Returns true if removed correctly, or false if error.
public static boolean
# set_labels( integer $id, array $label_array )

Set Labels to a Resource.

Set Labels to a Resource.

Parameters

$id
integer
$id Id of the Resource to set Labels to.
$label_array
array
$label_array Array of Label Ids to set to the Resource.

Returns

boolean
Returns true if added correctly, or false if error.
public static
# get_scope( mixed $id )
public static
# get_site( mixed $id, mixed $recursive = false )
public static
# get_example( mixed $id )
public static
# get_task( mixed $id )
public static integer|null
# get_group( integer $id )

Get the Group where a Resource is located

Get the Group where a Resource is located

Parameters

$id
integer
$id Resource ID

Returns

integer|null
Returns the Group ID, or null if none.
public static
# get_activity( mixed $id )
public static
# get_tricky_topic( mixed $id )
public static boolean
# add_tags( integer $id, array $tag_array )

Adds Tags to a Resource, referenced by Id.

Adds Tags to a Resource, referenced by Id.

Parameters

$id
integer
$id Id from the Resource to add Tags to
$tag_array
array
$tag_array Array of Tag Ids to be added to the Resource

Returns

boolean
Returns true if success, false if error
public static boolean
# remove_tags( integer $id, array $tag_array )

Remove Tags from a Resource.

Remove Tags from a Resource.

Parameters

$id
integer
$id Id from Resource to remove Tags from
$tag_array
array
$tag_array Array of Tag Ids to remove from Resource

Returns

boolean
Returns true if success, false if error
public static array[bool]
# get_read_status( integer $id, null|array $user_array = null )

Get a list of Users who have Read a Resource, or optionally whether certain Users have read it

Get a list of Users who have Read a Resource, or optionally whether certain Users have read it

Parameters

$id
integer
$id ID of the Resource
$user_array
null|array
$user_array List of User IDs - optional

Returns

array[bool]
Array with key => value: (int)user_id => (bool)read_status
public static boolean|integer
# set_read_status( integer $id, boolean $read_value, array $user_array )

Set the Read status for a Resource

Set the Read status for a Resource

Parameters

$id
integer
$id ID of Resource
$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 Resource if Ok, false if error

Throws

InvalidParameterException
public static boolean
# set_tags( integer $id, array $tag_array )

Sets Tags to a Resource, referenced by Id.

Sets Tags to a Resource, referenced by Id.

Parameters

$id
integer
$id Id from the Resource to set Tags to
$tag_array
array
$tag_array Array of Tag Ids to be set to the Resource

Returns

boolean
Returns true if success, false if error
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_RESOURCE_TAG "ClipitResource-ClipitTag"
#
string REL_RESOURCE_LABEL "ClipitResource-ClipitLabel"
#
string REL_RESOURCE_PERFORMANCE "ClipitResource-ClipitPerformanceItem"
#
string REL_RESOURCE_USER "ClipitResource-ClipitUser"
#
string REL_SITE_RESOURCE ""
#
string REL_EXAMPLE_RESOURCE ""
#
string REL_ACTIVITY_RESOURCE ""
#
string REL_TRICKYTOPIC_RESOURCE ""
#
string REL_TASK_RESOURCE ""
#
string REL_GROUP_RESOURCE ""
#
string SCOPE_GROUP "group"
#
string SCOPE_ACTIVITY "activity"
#
string SCOPE_SITE "site"
#
string SCOPE_EXAMPLE "example"
#
string SCOPE_TRICKYTOPIC "tricky_topic"
#
string SCOPE_TASK "task"
#
Constants inherited from UBItem
REL_PARENT_CLONE, SUBTYPE, TYPE
Properties summary
public array $tag_array array()
#
public array $performance_item_array array()
#
public array $label_array array()
#
public array $read_array array()
#
public float $overall_rating_average 0.0
#
public float $tag_rating_average 0.0
#
public float $performance_rating_average 0.0
#
Properties inherited from UBItem
$clone_array, $cloned_from, $description, $id, $name, $owner_id, $time_created, $url
API documentation generated by ApiGen 2.8.0