2 namespace Stock\Entity;
4 use Doctrine\ORM\Mapping as ORM;
10 * @ORM\Table(name="vehicle_damage", uniqueConstraints={@ORM\UniqueConstraint(name="unique_damage", columns={"name"})})
16 * Can archive records.
20 * Pull Synchronization Strategy for this table.
22 const PULL_SYNCH_STRATEGY = 'Build';
24 * Push Synchronization Strategy for this table.
26 const PUSH_SYNCH_STRATEGY = 'Build';
31 * @ORM\Column(type="integer");
32 * @ORM\GeneratedValue(strategy="AUTO")
37 * @ORM\Column(type="string", length=20, unique=true)
42 * @ORM\Column(type="boolean");
44 protected $archived = false;
49 * Magic getter to expose protected properties.
50 * @param string $property
53 public function __get($property)
55 return $this->$property;
59 * Magic setter to save protected properties.
60 * @param string $property
63 public function __set($property, $value)
65 $this->$property = $value;
69 * Convert the object to an array.
70 * @param array $expand
71 * @param array $intersect
74 public function toArray(array $expand = array(), array $intersect = array())
77 && $intersect = array_flip($intersect);
78 $includeAll = empty($intersect);
80 ($includeAll || isset($intersect['id']))
81 && $data['id'] = $this->id;
82 ($includeAll || isset($intersect['name']))
83 && $data['name'] = $this->name;
88 * Convert the object to an array for synchronization.
91 public function toSynchArray()
100 * Populate from an array.
103 public function fromArray($data = array())
106 && $this->id = $data['id'];
108 && $this->name = $data['name'];