/** * Receives a page in a different language tree, and tries to return the corresponding page in the current language tree. * * @return int|null */ public function getTranslatedPageID($page) { $ids = static::getIDList(); if (in_array($page->getCollectionID(), $ids)) { return $this->locale->getSiteTree()->getSiteHomePageID(); } $mpRelationID = self::getMultilingualPageRelationID($page->getCollectionID()); if ($mpRelationID) { $cID = self::getCollectionIDForLocale($mpRelationID, $this->getLocale()); return $cID; } }
public function delete(Locale $locale) { $tree = $locale->getSiteTree(); if (is_object($tree)) { $locale->setSiteTree(null); $this->entityManager->remove($tree); $this->entityManager->flush(); } $this->entityManager->remove($locale); $this->entityManager->flush(); }