public function getChildren() { if ($this->_children == 1) { if (!($_children = ProductCategory::find()->where(['parent_id' => $this->id])->andWhere(['is_active' => 1])->orderBy('position asc')->all())) { $_children = []; } $this->_children = $_children; } return $this->_children; }
public function findAllCategory() { $category = ProductCategory::find()->all(); return $category; }