2 namespace Company\Entity;
4 use Doctrine\ORM\Mapping as ORM;
11 * @ORM\Table(name="company_found_method_subcategory")
13 class FoundMethodDetail
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\ManyToOne(targetEntity="FoundMethod", inversedBy="methodDetails")
39 * @ORM\JoinColumn(name="company_found_method_id", referencedColumnName="id")
41 protected $foundMethod;
44 * @ORM\Column(type="string", length=100)
49 * @ORM\Column(type="boolean");
51 protected $archived = false;
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;
75 * Convert the object to an array.
76 * @param array $expand
77 * @param array $intersect
80 public function toArray(array $expand = array(), array $intersect = array())
82 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
83 $includeAll = empty($intersect);
85 ($includeAll || isset($intersect['id']))
86 && $data['id'] = $this->id;
87 ($includeAll || isset($intersect['foundMethod']))
88 && in_array('foundMethod', $expand)
89 && $data['foundMethod'] = $this->foundMethod->toArray($expand, $intersect);
90 ($includeAll || isset($intersect['name']))
91 && $data['name'] = $this->name;
96 * Populate from an array.
99 public function fromArray($data = array())
102 && $this->id = $data['id'];
103 isset($data['foundMethod'])
104 && $this->foundMethod = $data['foundMethod'];
106 && $this->name = $data['name'];