initial commit
[namibia] / module / PriceGuide / src / PriceGuide / Entity / MemberMake.php
1 <?php
2 namespace PriceGuide\Entity;
3
4 use Doctrine\ORM\Mapping as ORM;
5
6
7
8 /**
9  * @ORM\Entity
10  * @ORM\Table(name="price_guide_club_member_make")
11  */
12 class MemberMake
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="Member", inversedBy="makes")
38          * @ORM\JoinColumn(name="price_guide_club_member_id", referencedColumnName="id")
39          **/
40         protected $member;
41
42         /**
43          * @ORM\ManyToOne(targetEntity="\Stock\Entity\Make")
44          * @ORM\JoinColumn(name="vehicle_make_id", referencedColumnName="id")
45          **/
46         protected $make;
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['make']))
83                         && $data['make'] = $this->make->toArray($expand, $intersect);
84                 ($includeAll || isset($intersect['member']))
85                         && $data['member'] = $this->member->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['make'])
98                         && $this->make  = $data['make'];
99                 isset($data['member'])
100                         && $this->member  = $data['member'];
101         }
102
103 }