2 namespace Valuation\Entity;
4 use Doctrine\ORM\Mapping as ORM;
12 * @ORM\HasLifecycleCallbacks
13 * @ORM\Table(name="stock_valuation_deal_not_done_selection")
15 class DealNotDoneSelection
19 * Can archive records.
23 * Pull Synchronization Strategy for this table.
25 const PULL_SYNCH_STRATEGY = 'Build';
27 * Push Synchronization Strategy for this table.
29 const PUSH_SYNCH_STRATEGY = 'Update';
31 * Post insert action must be called after new entity is flushed to database.
33 const HAVE_POST_INSERT = true;
35 * Handle as a job queue for mobile devices.
37 const JOB_QUEUE = true;
39 /* ------------------------------------ Identification ------------------------------------ */
42 * @ORM\Column(type="integer");
43 * @ORM\GeneratedValue(strategy="AUTO")
48 * @ORM\Column(type="string", length=20, nullable=false, name="name");
53 * @ORM\Column(type="boolean");
55 protected $archived = false;
58 * Magic getter to expose protected properties.
60 * @param string $property
63 public function __get($property)
65 return $this->$property;
69 * Magic setter to save protected properties.
71 * @param string $property
74 public function __set($property, $value)
76 $this->$property = $value;
82 public function setCreateTime()
84 $this->created = new \DateTime("now");
90 public function setUpdateTime()
92 $this->updated = new \DateTime("now");
96 * Convert the object to an array.
97 * @param array $expand
98 * @param array $intersect
99 * @param boolean $showIdentifiers
100 * @param integer $expandAll
103 public function toArray(
104 array $expand = array(), array $intersect = array(),
105 $showIdentifiers = false, $expandAll = 0
108 $intersect = array_flip($intersect);
109 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
110 $includeAll = empty($intersect);
112 ($includeAll || isset($intersect['id']))
113 && $data['id'] = $this->id;
114 ($includeAll || isset($intersect['name']))
115 && $data['name'] = $this->name;
117 ($includeAll || isset($intersect['created']))
118 && $data['created'] = !is_null($this->created)
119 ? $this->created->format($dateTimeFormat)
121 ($includeAll || isset($intersect['updated']))
122 && $data['updated'] = !is_null($this->updated)
123 ? $this->updated->format($dateTimeFormat)
125 ($includeAll || isset($intersect['archived']))
126 && $data['archived'] = $this->archived;
133 * Populate from an array.
136 public function fromArray($data = array())
139 && $this->id = $data['id'];
141 && $this->name = $data['name'];