function getCollectionByKey($collectionKey) { if ($collectionKey == $this->collectionHomeKey) { $tempCollection = new Collection("home", true); foreach ($this->collections as $collection) { if ($collection->isHome == true) { $tempCollection->addCollection($collection->key); } } return $tempCollection; } else { foreach ($this->collections as $collection) { if ($collection->key == $collectionKey) { return $collection; } } } }