2 namespace PriceGuide\Entity;
4 use Doctrine\ORM\Mapping as ORM;
10 * @ORM\Table(name="price_guide_club_members")
16 * Can archive records.
20 * Pull Synchronization Strategy for this table.
22 const PULL_SYNCH_STRATEGY = false;
24 * Push Synchronization Strategy for this table.
26 const PUSH_SYNCH_STRATEGY = false;
31 * @ORM\Column(type="integer");
32 * @ORM\GeneratedValue(strategy="AUTO")
37 * @ORM\ManyToOne(targetEntity="Club", inversedBy="members")
38 * @ORM\JoinColumn(name="price_guide_club_id", referencedColumnName="id")
43 * @ORM\ManyToOne(targetEntity="Member", inversedBy="clubs")
44 * @ORM\JoinColumn(name="price_guide_member_id", referencedColumnName="id")
49 * @ORM\Column(type="boolean");
51 protected $archived = false;
56 * Magic getter to expose protected properties.
57 * @param string $property
60 public function __get($property)
62 return $this->$property;
66 * Magic setter to save protected properties.
67 * @param string $property
70 public function __set($property, $value)
72 $this->$property = $value;
76 * Convert the object to an array.
77 * @param array $expand
78 * @param array $intersect
81 public function toArray(array $expand = array(), array $intersect = array())
83 $includeAll = empty($intersect);
85 ($includeAll || isset($intersect['id']))
86 && $data['id'] = $this->id;
87 ($includeAll || isset($intersect['priceGuideStock']))
88 && $data['priceGuideStock'] = $this->priceGuideStock->toArray($expand, $intersect);
89 ($includeAll || isset($intersect['club']))
90 && $data['club'] = $this->club->toArray($expand, $intersect);
95 * Populate from an array.
98 public function fromArray($data = array())
101 && $this->id = $data['id'];
102 isset($data['priceGuideStock'])
103 && $this->priceGuideStock = $data['priceGuideStock'];
105 && $this->club = $data['club'];