text changes to registration mail content
[namibia] / module / Valuation / src / Valuation / Entity / SendToStockFrom.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_send_to_stock_from")
14  */
15 class SendToStockFrom
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          * Convert the object to an array.
81          * @param array $expand
82          * @param array $intersect
83          * @param boolean $showIdentifiers
84          * @param integer $expandAll
85          * @return array
86          */
87         public function toArray(
88                         array $expand = array(), array $intersect = array(),
89                         $showIdentifiers = false, $expandAll = 0
90                         )
91         {
92                 $intersect = array_flip($intersect);
93                 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
94                 $includeAll = empty($intersect);
95                 $data = array();
96                 ($includeAll || isset($intersect['id']))
97                         && $data['id'] = $this->id;
98                 ($includeAll || isset($intersect['name']))
99                         && $data['name'] = $this->name;
100
101
102         ($includeAll || isset($intersect['archived']))
103         && $data['archived'] = $this->archived;
104         return $data;
105         }
106
107
108
109         /**
110          * Populate from an array.
111          * @param array $data
112          */
113         public function fromArray($data = array())
114         {
115                 isset($data['id'])
116                         && $this->id = $data['id'];
117                 isset($data['name'])
118                         && $this->name = $data['name'];
119         }
120
121
122
123 }
124