Commit f9ff89a890939324737aa19be9749d5245ef53bb
1 parent
3bb4c5a7
add variantSku
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
models/Category.php
| ... | ... | @@ -32,6 +32,8 @@ |
| 32 | 32 | * @property TaxGroup[] $taxGroups |
| 33 | 33 | * @property Category[] $siblings |
| 34 | 34 | * @property Category $parentAR |
| 35 | + * @property Category $fullName | |
| 36 | + * @property Category $name | |
| 35 | 37 | * * From language behavior * |
| 36 | 38 | * @property CategoryLang $lang |
| 37 | 39 | * @property CategoryLang[] $langs |
| ... | ... | @@ -88,6 +90,21 @@ |
| 88 | 90 | ], |
| 89 | 91 | ]; |
| 90 | 92 | } |
| 93 | + | |
| 94 | + | |
| 95 | + public function getFullName(){ | |
| 96 | + if($this->parentAR != null){ | |
| 97 | + return $this->parentAR->name .' '.$this->name; | |
| 98 | + } else { | |
| 99 | + return $this->name; | |
| 100 | + } | |
| 101 | + | |
| 102 | + } | |
| 103 | + | |
| 104 | + | |
| 105 | + public function getName(){ | |
| 106 | + return !empty($this->lang->category_synonym) ?$this->lang->category_synonym : $this->lang->title; | |
| 107 | + } | |
| 91 | 108 | |
| 92 | 109 | /** |
| 93 | 110 | * @inheritdoc | ... | ... |