public function isGroupPlan() { $is_group_plan = true; foreach ($this->ratePlanDetails as $ratePlanDetails) { if ($ratePlanDetails->getOrganization()->getParent() == null) { $is_group_plan = false; break; } elseif ($ratePlanDetails->getOrganization()->getParent()->getId() != $this->organization->getId()) { $is_group_plan = false; break; } } return $is_group_plan; }
public function __toString() { $obj = array(); $obj['address'] = $this->addresses; $obj['organization'] = array('id' => $this->organization->getId()); $properties = array_keys(get_object_vars($this)); $excluded_properties = array_keys(get_class_vars(get_parent_class($this))); foreach ($properties as $property) { if ($property == 'address' || $property == 'organization' || in_array($property, $excluded_properties)) { continue; } if (isset($this->{$property})) { $obj[$property] = $this->{$property}; } } return json_encode($obj); }