2 namespace Person\Entity;
4 use Doctrine\ORM\Mapping as ORM;
9 * A country, in such a small file, imagine that.
11 * @ORM\Table(name="lib_contact")
17 * Can archive records.
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=50, nullable=true, name="first_name")
43 * @ORM\Column(type="string", length=50, nullable=true, name="family_name")
45 protected $familyName;
48 * @ORM\Column(type="string", length=20, nullable=true)
53 * @ORM\Column(type="string", length=20, nullable=true)
58 * @ORM\Column(type="string", length=20, nullable=true)
63 * @ORM\Column(type="string", length=255, nullable=true)
68 * @ORM\Column(type="boolean");
70 protected $archived = false;
74 * Magic getter to expose protected properties.
75 * @param string $property
78 public function __get($property)
80 return $this->$property;
84 * Magic setter to save protected properties.
85 * @param string $property
88 public function __set($property, $value)
90 $this->$property = $value;
94 * Convert the object to an array.
95 * @param array $expand
96 * @param array $intersect
99 public function toArray(array $expand = array(), array $intersect = array())
101 $includeAll = empty($intersect);
103 ($includeAll || isset($intersect['id']))
104 && $data['id'] = $this->id;
105 ($includeAll || isset($intersect['firstName']))
106 && $data['firstName'] = $this->firstName;
107 ($includeAll || isset($intersect['familyName']))
108 && $data['familyName'] = $this->familyName;
109 ($includeAll || isset($intersect['fullName']))
110 && $data['fullName'] = $this->firstName . ' ' . $this->familyName;
111 ($includeAll || isset($intersect['mobile']))
112 && $data['mobile'] = $this->mobile;
113 ($includeAll || isset($intersect['office']))
114 && $data['office'] = $this->office;
115 ($includeAll || isset($intersect['fax']))
116 && $data['fax'] = $this->fax;
117 ($includeAll || isset($intersect['email']))
118 && $data['email'] = $this->email;
123 * Populate from an array.
126 public function fromArray($data = array())
129 && $this->id = $data['id'];
130 isset($data['firstName'])
131 && $this->firstName = $data['firstName'];
132 isset($data['familyName'])
133 && $this->familyName = $data['familyName'];
134 isset($data['mobile'])
135 && $this->mobile = $data['mobile'];
136 isset($data['office'])
137 && $this->office = $data['office'];
139 && $this->fax = $data['fax'];
140 isset($data['email'])
141 && $this->email = $data['email'];