Example #1
0
 public function convertCategory(Models\Category\Category $category)
 {
     $struct = new Struct\Category();
     $struct->setId($category->getId());
     $struct->setName($category->getName());
     $struct->setPath($category->getPath());
     return $struct;
 }
Example #2
0
 /**
  * @param CategoryEntity $category
  * @return Category
  */
 public static function createFromCategoryEntity(CategoryEntity $category)
 {
     $struct = new self();
     $struct->setId($category->getId());
     $struct->setName($category->getName());
     $struct->setPosition($category->getPosition());
     $struct->setParentId($category->getParentId());
     $path = $category->getPath();
     if ($path) {
         $path = ltrim($path, '|');
         $path = rtrim($path, '|');
         $path = explode('|', $path);
         $struct->setPath(array_reverse($path));
     }
     return $struct;
 }
 /**
  * {@inheritDoc}
  */
 public function getName()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getName', array());
     return parent::getName();
 }