2 namespace Statistical\Entity;
4 use Doctrine\ORM\Mapping as ORM;
9 * Click tracking for banner adverts.
11 * @ORM\Table(name="lib_click")
17 * Can not archive records.
19 const ARCHIVE = false;
21 * Pull Synchronization Strategy for this table.
23 const PULL_SYNCH_STRATEGY = false;
25 * Push Synchronization Strategy for this table.
27 const PUSH_SYNCH_STRATEGY = false;
32 * @ORM\Column(type="integer");
33 * @ORM\GeneratedValue(strategy="AUTO")
38 * @ORM\Column(type="string", nullable=true, length=100, name="banner_id")
43 * @ORM\Column(type="string", nullable=true, length=100, name="ip_address")
48 * @ORM\Column(type="datetime");
55 * Magic getter to expose protected properties.
56 * @param string $property
59 public function __get($property)
61 return $this->$property;
65 * Magic setter to save protected properties.
66 * @param string $property
69 public function __set($property, $value)
71 $this->$property = $value;
78 public function setCreateTime()
80 $this->created = new \DateTime("now");
83 * Convert the object to an array.
84 * @param array $expand
85 * @param array $intersect
88 public function toArray(array $expand = array(), array $intersect = array())
90 $includeAll = empty($intersect);
92 ($includeAll || isset($intersect['id']))
93 && $data['id'] = $this->id;
94 ($includeAll || isset($intersect['ipAddress']))
95 && $data['ipAddress'] = $this->ipAddress;
96 ($includeAll || isset($intersect['bannerId']))
97 && $data['bannerId'] = $this->bannerId;
98 ($includeAll || isset($intersect['created']))
99 && $data['created'] = $this->created;
104 * Populate from an array.
107 public function fromArray($data = array())
110 && $this->id = $data['id'];
111 isset($data['ipAddress'])
112 && $this->ipAddress = $data['ipAddress'];
113 isset($data['bannerId'])
114 && $this->ipAddress = $data['bannerId'];
115 isset($data['created'])
116 && $this->created = $data['created'];