EventListener/DoctrineListener.php
public function prePersist(LifecycleEventArgs $event)
    {
        $entity = $event->getEntity();
        if ($entity instanceof Block) {
            $entity->setSlug($this->util->urlPathEncode($entity->getSlug()));
            $slug = $entity->getSlug();
            if(empty($slug)) {
                $entity->setSlug('block_ID');
            }
        }
        if ($entity instanceof Zone) {
            $entity->setSlug($this->util->urlPathEncode($entity->getSlug()));
            $slug = $entity->getSlug();
            if(empty($slug)) {
                $entity->setSlug('zone_ID');
            }
        } 
        if ($entity instanceof Page) {
            $entity->setUrlTitle($this->util->urlPathEncode($entity->getTitle()));
            $entity->setSlug($this->util->urlPathEncode($entity->getSlug()));
            $slug = $entity->getSlug();
            if(empty($slug)) {
                $entity->setSlug('page_ID');
            }
            if($entity->getIsInNavigation() == 1) {
                $this->unpublishNav();
            }
        }
    }
public function prePersist(LifecycleEventArgs $event)
    {
        $entity = $event->getEntity();
        if ($entity instanceof Block) {
            $entity->setSlug($this->util->urlPathEncode($entity->getSlug()));
            $slug = $entity->getSlug();
            if(empty($slug)) {
                $entity->setSlug('block_ID');
            }
        }
        if ($entity instanceof Zone) {
            $entity->setSlug($this->util->urlPathEncode($entity->getSlug()));
            $slug = $entity->getSlug();
            if(empty($slug)) {
                $entity->setSlug('zone_ID');
            }
        } 
        if ($entity instanceof Page) {
            $entity->setUrlTitle($this->util->urlPathEncode($entity->getTitle()));
            $entity->setSlug($this->util->urlPathEncode($entity->getSlug()));
            $slug = $entity->getSlug();
            if(empty($slug)) {
                $entity->setSlug('page_ID');
            }
            if($entity->getIsInNavigation() == 1) {
                $this->unpublishNav();
            }
        }
    }
//