text changes to registration mail content
[namibia] / module / Valuation / src / Valuation / Entity / DealNotDoneSelection.php
1 <?php
2 namespace Valuation\Entity;
3
4 use Doctrine\ORM\Mapping as ORM;
5
6
7
8 /**
9  * A valuation.
10  *
11  * @ORM\Entity
12  * @ORM\HasLifecycleCallbacks
13  * @ORM\Table(name="stock_valuation_deal_not_done_selection")
14  */
15 class DealNotDoneSelection
16 {
17
18         /**
19          * Can archive records.
20          */
21         const ARCHIVE = true;
22         /**
23          * Pull Synchronization Strategy for this table.
24          */
25         const PULL_SYNCH_STRATEGY = 'Build';
26         /**
27          * Push Synchronization Strategy for this table.
28          */
29         const PUSH_SYNCH_STRATEGY = 'Update';
30         /**
31          * Post insert action must be called after new entity is flushed to database.
32          */
33         const HAVE_POST_INSERT = true;
34         /**
35          * Handle as a job queue for mobile devices.
36          */
37         const JOB_QUEUE = true;
38
39         /* ------------------------------------ Identification ------------------------------------ */
40         /**
41          * @ORM\Id
42          * @ORM\Column(type="integer");
43          * @ORM\GeneratedValue(strategy="AUTO")
44          */
45     protected $id;
46
47         /**
48          * @ORM\Column(type="string", length=20, nullable=false, name="name");
49          */
50     protected $name;
51
52         /**
53          * @ORM\Column(type="boolean");
54          */
55     protected $archived = false;
56
57     /**
58      * Magic getter to expose protected properties.
59      *
60      * @param string $property
61      * @return mixed
62      */
63     public function __get($property)
64     {
65         return $this->$property;
66     }
67
68     /**
69      * Magic setter to save protected properties.
70      *
71      * @param string $property
72      * @param mixed $value
73      */
74     public function __set($property, $value)
75     {
76         $this->$property = $value;
77     }
78
79         /**
80          * @ORM\PrePersist
81          */
82         public function setCreateTime()
83         {
84                 $this->created = new \DateTime("now");
85         }
86
87         /**
88          * @ORM\PreUpdate
89          */
90         public function setUpdateTime()
91         {
92                 $this->updated = new \DateTime("now");
93         }
94
95         /**
96          * Convert the object to an array.
97          * @param array $expand
98          * @param array $intersect
99          * @param boolean $showIdentifiers
100          * @param integer $expandAll
101          * @return array
102          */
103         public function toArray(
104                         array $expand = array(), array $intersect = array(),
105                         $showIdentifiers = false, $expandAll = 0
106                         )
107         {
108                 $intersect = array_flip($intersect);
109                 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
110                 $includeAll = empty($intersect);
111                 $data = array();
112                 ($includeAll || isset($intersect['id']))
113                         && $data['id'] = $this->id;
114                 ($includeAll || isset($intersect['name']))
115                         && $data['name'] = $this->name;
116
117         ($includeAll || isset($intersect['created']))
118         && $data['created'] = !is_null($this->created)
119             ? $this->created->format($dateTimeFormat)
120             : null;
121         ($includeAll || isset($intersect['updated']))
122         && $data['updated'] = !is_null($this->updated)
123             ? $this->updated->format($dateTimeFormat)
124             : null;
125         ($includeAll || isset($intersect['archived']))
126         && $data['archived'] = $this->archived;
127         return $data;
128         }
129
130
131
132         /**
133          * Populate from an array.
134          * @param array $data
135          */
136         public function fromArray($data = array())
137         {
138                 isset($data['id'])
139                         && $this->id = $data['id'];
140                 isset($data['name'])
141                         && $this->name = $data['name'];
142         }
143
144
145
146 }
147