initial commit
[namibia] / module / Utility / src / Utility / Entity / Video.php
1 <?php
2 namespace Utility\Entity;
3
4 use Doctrine\ORM\Mapping as ORM;
5
6
7
8 /**
9  * A video.
10  * @ORM\Entity
11  * @ORM\Table(name="lib_video")
12  */
13 class Video
14 {
15
16         /**
17          * Can archive records.
18          */
19         const ARCHIVE = true;
20         /**
21          * Pull Synchronization Strategy for this table.
22          */
23         const PULL_SYNCH_STRATEGY = false;
24         /**
25          * Push Synchronization Strategy for this table.
26          */
27         const PUSH_SYNCH_STRATEGY = false;
28
29         /**
30          * @ORM\Id
31          * @ORM\Column(type="integer");
32          * @ORM\GeneratedValue(strategy="AUTO")
33          */
34         protected $id;
35
36         /**
37          * @ORM\Column(type="string", length=250)
38          */
39         protected $filename;
40
41         /**
42          * @ORM\Column(type="string", length=200, name="mime_type")
43          */
44         protected $mimeType;
45
46         /**
47          * @ORM\Column(type="boolean");
48          */
49         protected $archived = false;
50
51
52         /**
53          * Magic getter to expose protected properties.
54          * @param string $property
55          * @return mixed
56          */
57         public function __get($property)
58         {
59                 return $this->$property;
60         }
61
62         /**
63          * Magic setter to save protected properties.
64          * @param string $property
65          * @param mixed $value
66          */
67         public function __set($property, $value)
68         {
69                 $this->$property = $value;
70         }
71
72         /**
73          * Convert the object to an array.
74          * @param array $expand
75          * @return array
76          */
77         public function toArray(array $expand = array())
78         {
79                 return array(
80                                 'id'        => $this->id,
81                                 'filename'  => $this->filename,
82                                 'mimeType'  => $this->mimeType
83                 );
84         }
85
86         /**
87          * Populate from an array.
88          * @param array $data
89          */
90         public function fromArray($data = array())
91         {
92                 isset($data['id'])
93                         && $this->id = $data['id'];
94                 isset($data['filename'])
95                         && $this->filename  = $data['filename'];
96                 isset($data['mimeType'])
97                         && $this->mimeType  = $data['mimeType'];
98         }
99
100 }