1: <?php
2: /**
3: * ClipIt - JuxtaLearn Web Space
4: * PHP version: >= 5.2
5: * Creation date: 2013-10-10
6: * Last update: $Date$
7: * @author Pablo LlinĂ¡s Arnaiz <pebs74@gmail.com>, URJC JuxtaLearn Team
8: * @version $Version$
9: * @link http://www.juxtalearn.eu
10: * @license GNU Affero General Public License v3
11: * @package ClipIt
12: * @subpackage clipit_api
13: */
14:
15: /**
16: * A Storyboard object linking to a binary file to use with external authoring component.
17: */
18: class ClipitStoryboard extends ClipitResource {
19: /**
20: * @const string Elgg entity SUBTYPE for this class
21: */
22: const SUBTYPE = "ClipitStoryboard";
23: const REL_RESOURCE_TAG = "ClipitStoryboard-ClipitTag";
24: const REL_RESOURCE_PERFORMANCE = "ClipitStoryboard-ClipitPerformanceItem";
25: const REL_RESOURCE_LABEL = "ClipitStoryboard-ClipitLabel";
26: const REL_RESOURCE_USER = "ClipitStoryboard-ClipitUser";
27: const REL_EXAMPLE_RESOURCE = ClipitExample::REL_EXAMPLE_STORYBOARD;
28: const REL_GROUP_RESOURCE = ClipitGroup::REL_GROUP_STORYBOARD;
29: const REL_TASK_RESOURCE = ClipitTask::REL_TASK_STORYBOARD;
30: const REL_ACTIVITY_RESOURCE = ClipitActivity::REL_ACTIVITY_STORYBOARD;
31: const REL_TRICKYTOPIC_RESOURCE = ClipitTrickyTopic::REL_TRICKYTOPIC_STORYBOARD;
32: const REL_SITE_RESOURCE = ClipitSite::REL_SITE_STORYBOARD;
33: public $file = 0;
34:
35: /**
36: * Loads object parameters stored in Elgg
37: *
38: * @param ElggEntity $elgg_entity Elgg Object to load parameters from.
39: */
40: protected function copy_from_elgg($elgg_entity) {
41: parent::copy_from_elgg($elgg_entity);
42: $this->file = (int)$elgg_entity->get("file");
43: }
44:
45: /**
46: * Copy $this object parameters into an Elgg entity.
47: *
48: * @param ElggEntity $elgg_entity Elgg object instance to save $this to
49: */
50: protected function copy_to_elgg($elgg_entity) {
51: parent::copy_to_elgg($elgg_entity);
52: $elgg_entity->set("file", (int)$this->file);
53: }
54: }