initial commit
[namibia] / module / Company / src / Company / Entity / FoundMethodDetail.php
1 <?php
2 namespace Company\Entity;
3
4 use Doctrine\ORM\Mapping as ORM;
5
6
7
8 /**
9  * Found Method Detail.
10  * @ORM\Entity
11  * @ORM\Table(name="company_found_method_subcategory")
12  */
13 class FoundMethodDetail
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         /**
31          * @ORM\Id
32          * @ORM\Column(type="integer");
33          * @ORM\GeneratedValue(strategy="AUTO")
34          */
35         protected $id;
36
37         /**
38          * @ORM\ManyToOne(targetEntity="FoundMethod", inversedBy="methodDetails")
39          * @ORM\JoinColumn(name="company_found_method_id", referencedColumnName="id")
40          **/
41         protected $foundMethod;
42
43         /**
44          * @ORM\Column(type="string", length=100)
45          */
46         protected $name;
47
48         /**
49          * @ORM\Column(type="boolean");
50          */
51         protected $archived = false;
52
53
54         /**
55          * Magic getter to expose protected properties.
56          * @param string $property
57          * @return mixed
58          */
59         public function __get($property)
60         {
61                 return $this->$property;
62         }
63
64         /**
65          * Magic setter to save protected properties.
66          * @param string $property
67          * @param mixed $value
68          */
69         public function __set($property, $value)
70         {
71                 $this->$property = $value;
72         }
73
74         /**
75          * Convert the object to an array.
76          * @param array $expand
77          * @param array $intersect
78          * @return array
79          */
80         public function toArray(array $expand = array(), array $intersect = array())
81         {
82                 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
83                 $includeAll = empty($intersect);
84                 $data = array();
85                 ($includeAll || isset($intersect['id']))
86                         && $data['id'] = $this->id;
87                 ($includeAll || isset($intersect['foundMethod']))
88                         && in_array('foundMethod', $expand)
89                         && $data['foundMethod'] = $this->foundMethod->toArray($expand, $intersect);
90                 ($includeAll || isset($intersect['name']))
91                         && $data['name'] = $this->name;
92                 return $data;
93         }
94
95         /**
96          * Populate from an array.
97          * @param array $data
98          */
99         public function fromArray($data = array())
100         {
101                 isset($data['id'])
102                         && $this->id = $data['id'];
103                 isset($data['foundMethod'])
104                         && $this->foundMethod = $data['foundMethod'];
105                 isset($data['name'])
106                         && $this->name = $data['name'];
107         }
108
109 }