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 ClipitFile

A binary file with thumbnails (in case of images), and can be tagged and labeled.

UBItem
Extended by UBFile
Extended by ClipitFile
Package: ClipIt\clipit\api
License: Affero General Public License v3
Author: Pablo LlinĂ¡s Arnaiz <pebs74@gmail.com>, URJC JuxtaLearn Team
Located at ClipitFile.php
Methods summary
protected
# copy_from_elgg( ElggFile $elgg_file )

Loads object parameters stored in Elgg

Loads object parameters stored in Elgg

Parameters

$elgg_file
ElggFile
$elgg_file Elgg Object to load parameters from.

Overrides

UBFile::copy_from_elgg()
protected
# copy_to_elgg( ElggFile $elgg_file )

Copy $this object parameters into an Elgg file.

Copy $this object parameters into an Elgg file.

Parameters

$elgg_file
ElggFile
$elgg_file Elgg file instance to save $this to

Overrides

UBFile::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 Specifies whether to save file twice (necessary for file_creation_date edit)

Returns

boolean|integer
Returns id of saved instance, or false if error.

Overrides

UBFile::save()
public static
# get_by_tags( mixed $tag_array )
public static
# get_by_labels( mixed $label_array )
public static
# get_scope( mixed $id )
public static
# get_site( mixed $id, mixed $recursive = false )
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_example( mixed $id )
public static
# get_tricky_topic( mixed $id )
public static boolean
# add_tags( integer $id, array $tag_array )

Add Tags to a File.

Add Tags to a File.

Parameters

$id
integer
$id Id of the File to add Tags to.
$tag_array
array
$tag_array Array of Tag Ids to add to the File.

Returns

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

Remove Tags from a File.

Remove Tags from a File.

Parameters

$id
integer
$id Id of the File to remove Tags from.
$tag_array
array
$tag_array Array of Tags Ids to remove from the File.

Returns

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

Add Labels to a File.

Add Labels to a File.

Parameters

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

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 File.

Remove Labels from a File.

Parameters

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

Returns

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

Add Read Array for a File

Add Read Array for a File

Parameters

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

Returns

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

Set Read Array for a File

Set Read Array for a File

Parameters

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

Returns

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

Remove Read Array for a File

Remove Read Array for a File

Parameters

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

Returns

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

Get Read Array for a File

Get Read Array for a File

Parameters

$id
integer
$id ID of the File

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 File, or optionally whether certain Users have read it

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

Parameters

$id
integer
$id ID of the File
$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 File

Set the Read status for a File

Parameters

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

Throws

InvalidParameterException
public static int[]
# get_tags( integer $id )

Get Tag Ids from a File.

Get Tag Ids from a File.

Parameters

$id
integer
$id Id of the File to get Tags from.

Returns

int[]
Returns array of Tag Ids, or false if error.
public static int[]
# get_labels( integer $id )

Get Label Ids from a File.

Get Label Ids from a File.

Parameters

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

Returns

int[]
Returns array of Label Ids, or false if error.
public static boolean
# set_tags( integer $id, array $tag_array )

Set Tags to a File.

Set Tags to a File.

Parameters

$id
integer
$id Id of the File to set Tags to.
$tag_array
array
$tag_array Array of Tag Ids to set to the File.

Returns

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

Set Labels to a File.

Set Labels to a File.

Parameters

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

Returns

boolean
Returns true if added correctly, or false if error.
Methods inherited from UBFile
__construct(), create_clone(), get_mime_type(), get_simple_mime_type()
Methods inherited from UBItem
count_all(), create(), 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_FILE_TAG "ClipitFile-ClipitTag"
#
string REL_FILE_LABEL "ClipitFile-ClipitLabel"
#
string REL_FILE_USER "ClipitFile-ClipitUser"
#
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 UBFile
DEFAULT_FILENAME, THUMB_LARGE, THUMB_MEDIUM, THUMB_SMALL, TIMESTAMP_DELIMITER
Constants inherited from UBItem
REL_PARENT_CLONE, SUBTYPE, TYPE
Properties summary
public array $tag_array array()
#
public array $label_array array()
#
public array $read_array array()
#
Properties inherited from UBFile
$data, $file_path, $mime_type, $size, $temp_path, $thumb_large, $thumb_medium, $thumb_small
Properties inherited from UBItem
$clone_array, $cloned_from, $description, $id, $name, $owner_id, $time_created, $url
API documentation generated by ApiGen 2.8.0