<?php

namespace Shop\Models\Category;

use Shop\Models\Category\Base\Category as BaseCategory;

/**
 * Skeleton subclass for representing a row from the 'shop_categories' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 */
class Category extends BaseCategory
{

    /**
     * @deprecated 
     * @param type $name
     * @return type
     */
    public function getNameWithParent($name = " одежда, ")
    {
        return ltrim(
                
                sprintf("%s%s%s",$this->getParentCategory()? $this->getParentCategory()->getTitle():null, $name, $this->getTitle())
                ,
                " -"
                )
                ;
    }
    
    /**
     * 
     * @param type $name
     * @return type
     */
    public function getNameWithParentName($name = " / ")
    {
        return ltrim(
                
                sprintf("%s%s%s",$this->getParentCategory()? $this->getParentCategory()->getTitle():null,$name,$this->getTitle())
                ,
                $name
                )
                ;
    }    
}
