function getAllObjects() { $hours = new LocationHours(); $hours->orderBy('locationId, day'); $hours->find(); $list = array(); while ($hours->fetch()) { $list[$hours->id] = clone $hours; } return $list; }
public function __get($name) { if ($name == "hours") { if (!isset($this->hours)) { $this->hours = array(); if ($this->locationId) { $hours = new LocationHours(); $hours->locationId = $this->locationId; $hours->orderBy('day'); $hours->find(); while ($hours->fetch()) { $this->hours[$hours->id] = clone $hours; } } } return $this->hours; } elseif ($name == "facets") { if (!isset($this->facets)) { $this->facets = array(); if ($this->locationId) { $facet = new LocationFacetSetting(); $facet->locationId = $this->locationId; $facet->orderBy('weight'); $facet->find(); while ($facet->fetch()) { $this->facets[$facet->id] = clone $facet; } } } return $this->facets; } else { return $this->data[$name]; } }
public function __get($name) { if ($name == "hours") { if (!isset($this->hours)) { $this->hours = array(); if ($this->locationId) { $hours = new LocationHours(); $hours->locationId = $this->locationId; $hours->orderBy('day'); $hours->find(); while ($hours->fetch()) { $this->hours[$hours->id] = clone $hours; } } } return $this->hours; } elseif ($name == "moreDetailsOptions") { if (!isset($this->moreDetailsOptions) && $this->libraryId) { $this->moreDetailsOptions = array(); $moreDetailsOptions = new LocationMoreDetails(); $moreDetailsOptions->locationId = $this->locationId; $moreDetailsOptions->orderBy('weight'); $moreDetailsOptions->find(); while ($moreDetailsOptions->fetch()) { $this->moreDetailsOptions[$moreDetailsOptions->id] = clone $moreDetailsOptions; } } return $this->moreDetailsOptions; } elseif ($name == "facets") { if (!isset($this->facets)) { $this->facets = array(); if ($this->locationId) { $facet = new LocationFacetSetting(); $facet->locationId = $this->locationId; $facet->orderBy('weight'); $facet->find(); while ($facet->fetch()) { $this->facets[$facet->id] = clone $facet; } } } return $this->facets; } elseif ($name == 'browseCategories') { if (!isset($this->browseCategories) && $this->locationId) { $this->browseCategories = array(); $browseCategory = new LocationBrowseCategory(); $browseCategory->locationId = $this->locationId; $browseCategory->orderBy('weight'); $browseCategory->find(); while ($browseCategory->fetch()) { $this->browseCategories[$browseCategory->id] = clone $browseCategory; } } return $this->browseCategories; } else { return $this->data[$name]; } }