text changes to registration mail content
[namibia] / module / Company / src / Company / Entity / FoundMethod.php
1 <?php
2 namespace Company\Entity;
3
4 use Doctrine\ORM\Mapping as ORM;
5
6
7
8 /**
9  * Found Method.
10  * @ORM\Entity
11  * @ORM\Table(name="company_found_method")
12  */
13 class FoundMethod
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\Column(type="string", length=100)
39          */
40         protected $name;
41
42         /**
43          * @ORM\Column(type="boolean");
44          */
45         protected $archived = false;
46
47         /**
48          * @ORM\OneToMany(targetEntity="FoundMethodDetail", mappedBy="foundMethod", fetch="EXTRA_LAZY")
49          **/
50         private $methodDetails;
51
52
53         /**
54          * Initialize collections.
55          */
56         public function __construct()
57         {
58                 $this->methodDetails = new \Doctrine\Common\Collections\ArrayCollection();
59         }
60
61         /**
62          * Add detail entry for this method.
63          * @param Town $town
64          * @return \Location\Entity\Region
65          */
66         public function addDetail(FoundMethodDetail $methodDetail)
67         {
68                 $this->methodDetails[] = $methodDetail;
69                 return $this;
70         }
71
72         /**
73          * Magic getter to expose protected properties.
74          * @param string $property
75          * @return mixed
76          */
77         public function __get($property)
78         {
79                 return $this->$property;
80         }
81
82         /**
83          * Magic setter to save protected properties.
84          * @param string $property
85          * @param mixed $value
86          */
87         public function __set($property, $value)
88         {
89                 $this->$property = $value;
90         }
91
92         /**
93          * Convert the object to an array.
94          * @param array $expand
95          * @param array $intersect
96          * @return array
97          */
98         public function toArray(array $expand = array(), array $intersect = array())
99         {
100                 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
101                 $includeAll = empty($intersect);
102                 $data = array();
103                 ($includeAll || isset($intersect['id']))
104                         && $data['id'] = $this->id;
105                 ($includeAll || isset($intersect['name']))
106                         && $data['name'] = $this->name;
107                 return $data;
108         }
109
110         /**
111          * Populate from an array.
112          * @param array $data
113          */
114         public function fromArray($data = array())
115         {
116                 isset($data['id'])
117                         && $this->id = $data['id'];
118                 isset($data['name'])
119                         && $this->name = $data['name'];
120         }
121
122 }