public function prePersist($document)
 {
     $parent = $this->getModelManager()->find(null, '/cms/londa/google_markers');
     $document->setParentDocument($parent);
     $slug = Slugger::slugify($document->getCategory());
     $document->setCategorySlug($slug);
 }
 public function prePersist($manifestoIssue)
 {
     $parent = $this->getModelManager()->find(null, '/cms/londa/manifesto_issues');
     $manifestoIssue->setParentDocument($parent);
     $titleSlug = Slugger::slugify($manifestoIssue->getTitle());
     $manifestoIssue->setTitleSlug($titleSlug);
 }
 private function createPageRoute($pageTitle)
 {
     $route = new Route();
     $route->setParentDocument($this->getModelManager()->find(null, '/cms/londa/routes'));
     //@TODO Get route path from configs
     $route->setName(Slugger::slugify($pageTitle));
     return $route;
 }
 public function prePersist($candidate)
 {
     $parent = $this->getModelManager()->find(null, '/cms/londa/candidates');
     $candidate->setParentDocument($parent);
     $partySlug = Slugger::slugify($candidate->getParty());
     $candidate->setPartySlug($partySlug);
     $postSlug = Slugger::slugify($candidate->getPost());
     $candidate->setPostSlug($postSlug);
 }