diff --git a/models/Category.php b/models/Category.php index ce911ac..16bcffd 100755 --- a/models/Category.php +++ b/models/Category.php @@ -32,6 +32,8 @@ * @property TaxGroup[] $taxGroups * @property Category[] $siblings * @property Category $parentAR + * @property Category $fullName + * @property Category $name * * From language behavior * * @property CategoryLang $lang * @property CategoryLang[] $langs @@ -88,6 +90,21 @@ ], ]; } + + + public function getFullName(){ + if($this->parentAR != null){ + return $this->parentAR->name .' '.$this->name; + } else { + return $this->name; + } + + } + + + public function getName(){ + return !empty($this->lang->category_synonym) ?$this->lang->category_synonym : $this->lang->title; + } /** * @inheritdoc -- libgit2 0.21.4