public function __get($name) { if ($name == "holidays") { if (!isset($this->holidays) && $this->libraryId) { $this->holidays = array(); $holiday = new Holiday(); $holiday->libraryId = $this->libraryId; $holiday->orderBy('date'); $holiday->find(); while ($holiday->fetch()) { $this->holidays[$holiday->id] = clone $holiday; } } return $this->holidays; } elseif ($name == "nearbyBookStores") { if (!isset($this->nearbyBookStores) && $this->libraryId) { $this->nearbyBookStores = array(); $store = new NearbyBookStore(); $store->libraryId = $this->libraryId; $store->orderBy('weight'); $store->find(); while ($store->fetch()) { $this->nearbyBookStores[$store->id] = clone $store; } } return $this->nearbyBookStores; } elseif ($name == "moreDetailsOptions") { if (!isset($this->moreDetailsOptions) && $this->libraryId) { $this->moreDetailsOptions = array(); $moreDetailsOptions = new LibraryMoreDetails(); $moreDetailsOptions->libraryId = $this->libraryId; $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->libraryId) { $this->facets = array(); $facet = new LibraryFacetSetting(); $facet->libraryId = $this->libraryId; $facet->orderBy('weight'); $facet->find(); while ($facet->fetch()) { $this->facets[$facet->id] = clone $facet; } } return $this->facets; } elseif ($name == 'searchSources') { if (!isset($this->searchSources) && $this->libraryId) { $this->searchSources = array(); $searchSource = new LibrarySearchSource(); $searchSource->libraryId = $this->libraryId; $searchSource->orderBy('weight'); $searchSource->find(); while ($searchSource->fetch()) { $this->searchSources[$searchSource->id] = clone $searchSource; } } return $this->searchSources; } elseif ($name == 'libraryLinks') { if (!isset($this->libraryLinks) && $this->libraryId) { $this->libraryLinks = array(); $libraryLink = new LibraryLinks(); $libraryLink->libraryId = $this->libraryId; $libraryLink->orderBy('weight'); $libraryLink->find(); while ($libraryLink->fetch()) { $this->libraryLinks[$libraryLink->id] = clone $libraryLink; } } return $this->libraryLinks; } elseif ($name == 'libraryTopLinks') { if (!isset($this->libraryTopLinks) && $this->libraryId) { $this->libraryTopLinks = array(); $libraryLink = new LibraryTopLinks(); $libraryLink->libraryId = $this->libraryId; $libraryLink->orderBy('weight'); $libraryLink->find(); while ($libraryLink->fetch()) { $this->libraryTopLinks[$libraryLink->id] = clone $libraryLink; } } return $this->libraryTopLinks; } elseif ($name == 'browseCategories') { if (!isset($this->browseCategories) && $this->libraryId) { $this->browseCategories = array(); $browseCategory = new LibraryBrowseCategory(); $browseCategory->libraryId = $this->libraryId; $browseCategory->orderBy('weight'); $browseCategory->find(); while ($browseCategory->fetch()) { $this->browseCategories[$browseCategory->id] = clone $browseCategory; } } return $this->browseCategories; } else { return $this->data[$name]; } }
public function __get($name) { if ($name == "holidays") { if (!isset($this->holidays) && $this->libraryId) { $this->holidays = array(); $holiday = new Holiday(); $holiday->libraryId = $this->libraryId; $holiday->orderBy('date'); $holiday->find(); while ($holiday->fetch()) { $this->holidays[$holiday->id] = clone $holiday; } } return $this->holidays; } elseif ($name == "nearbyBookStores") { if (!isset($this->nearbyBookStores) && $this->libraryId) { $this->nearbyBookStores = array(); $store = new NearbyBookStore(); $store->libraryId = $this->libraryId; $store->orderBy('weight'); $store->find(); while ($store->fetch()) { $this->nearbyBookStores[$store->id] = clone $store; } } return $this->nearbyBookStores; } elseif ($name == "facets") { if (!isset($this->facets) && $this->libraryId) { $this->facets = array(); $facet = new LibraryFacetSetting(); $facet->libraryId = $this->libraryId; $facet->orderBy('weight'); $facet->find(); while ($facet->fetch()) { $this->facets[$facet->id] = clone $facet; } } return $this->facets; } elseif ($name == 'searchSources') { if (!isset($this->searchSources) && $this->libraryId) { $this->searchSources = array(); $searchSource = new LibrarySearchSource(); $searchSource->libraryId = $this->libraryId; $searchSource->orderBy('weight'); $searchSource->find(); while ($searchSource->fetch()) { $this->searchSources[$searchSource->id] = clone $searchSource; } } return $this->searchSources; } else { return $this->data[$name]; } }