Example #1
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 getPosition()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPosition', array());
     return parent::getPosition();
 }