2 namespace Retail\Entity;
4 use Doctrine\ORM\Mapping as ORM;
10 * @ORM\HasLifecycleCallbacks
11 * @ORM\Table(name="retail", uniqueConstraints={@ORM\UniqueConstraint(name="unique_retailer", columns={"name"})})
17 * Can 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", length=150, unique=true)
43 * @ORM\Column(type="string", length=64, name="auth_token")
48 * @ORM\Column(type="integer");
50 protected $requests = 0;
53 * @ORM\Column(type="datetime");
58 * @ORM\Column(type="datetime", nullable=true);
65 * Magic getter to expose protected properties.
66 * @param string $property
69 public function __get($property)
71 return $this->$property;
75 * Magic setter to save protected properties.
76 * @param string $property
79 public function __set($property, $value)
81 $this->$property = $value;
88 public function setCreateTime()
90 $this->created = new \DateTime("now");
96 public function setUpdateTime()
98 $this->updated = new \DateTime("now");
101 public function fromArray($data)
104 && $this->name = $data['name'];
105 isset($data['authToken'])
106 && $this->authToken = $data['authToken'];
107 isset($data['requests'])
108 && $this->requests = $data['requests'];
111 public function toArray()
115 'name' => $this->name