2 namespace Company\Entity;
4 use Doctrine\ORM\Mapping as ORM;
11 * @ORM\Table(name="company_found_method")
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=100)
43 * @ORM\Column(type="boolean");
45 protected $archived = false;
48 * @ORM\OneToMany(targetEntity="FoundMethodDetail", mappedBy="foundMethod", fetch="EXTRA_LAZY")
50 private $methodDetails;
54 * Initialize collections.
56 public function __construct()
58 $this->methodDetails = new \Doctrine\Common\Collections\ArrayCollection();
62 * Add detail entry for this method.
64 * @return \Location\Entity\Region
66 public function addDetail(FoundMethodDetail $methodDetail)
68 $this->methodDetails[] = $methodDetail;
73 * Magic getter to expose protected properties.
74 * @param string $property
77 public function __get($property)
79 return $this->$property;
83 * Magic setter to save protected properties.
84 * @param string $property
87 public function __set($property, $value)
89 $this->$property = $value;
93 * Convert the object to an array.
94 * @param array $expand
95 * @param array $intersect
98 public function toArray(array $expand = array(), array $intersect = array())
100 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
101 $includeAll = empty($intersect);
103 ($includeAll || isset($intersect['id']))
104 && $data['id'] = $this->id;
105 ($includeAll || isset($intersect['name']))
106 && $data['name'] = $this->name;
111 * Populate from an array.
114 public function fromArray($data = array())
117 && $this->id = $data['id'];
119 && $this->name = $data['name'];