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