Entity/Category.php
public function generateSlugAndPath()
    {
        // Set slug for this Category
        $this->slug = \Gedmo\Sluggable\Util\Urlizer::urlize($this->title);

        $category = $this;

        $pathSegments = array($category->getSlug());

        while ($category->getParent())
        {
            $category       = $category->getParent();
            $pathSegments[] = $category->getSlug();
        }

        $this->setPath(implode('/', array_reverse($pathSegments)));
    }
public function generateSlugAndPath()
    {
        // Set slug for this Category
        $this->slug = \Gedmo\Sluggable\Util\Urlizer::urlize($this->title);

        $category = $this;

        $pathSegments = array($category->getSlug());

        while ($category->getParent())
        {
            $category       = $category->getParent();
            $pathSegments[] = $category->getSlug();
        }

        $this->setPath(implode('/', array_reverse($pathSegments)));
    }
public function generateSlugAndPath ( ) { // Set slug for this Category $ this -> slug = \ Gedmo \ Sluggable \ Util \ Urlizer :: urlize ( $ this -> title ) ; $ category = $ this ; $ pathSegments = array ( $ category -> getSlug ( ) ) ; while ( $ category -> getParent ( ) ) { $ category = $ category -> getParent ( ) ; $ pathSegments [ ] = $ category -> getSlug ( ) ; } $ this -> setPath ( implode ( '/' , array_reverse ( $ pathSegments ) ) ) ; }
Generate slug and path

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2012-04-18

@ORM\PrePersist
@ORM\PreUpdate
Generate slug and path