public function getPath() { $result = []; $query = $this->hasOne(Category::className(), ['id' => 'category_id']); $category = $query->one(); while ($category) { $result[] = $category; $category = $category->category; } return $result; }
/** * @return \yii\db\ActiveQuery */ public function getParent() { return $this->hasOne(Category::className(), ['id_categoria' => 'parent_id']); }
public function getCategory() { return $this->hasOne(Category::className(), ["cid" => "cid"]); }
public function getCategories() { return $this->hasOne(Category::className(), ['id' => 'category']); }
/** * @return CategoryQuery */ public function getCategory() { return $this->hasOne(Category::className(), ['CategoryID' => 'CategoryID'])->inverseOf('products'); }
/** * @return \yii\db\ActiveQuery */ public function getChildren() { return $this->hasMany(Category::className(), ['parent_id' => 'id']); }
public function getCategories() { return $this->hasMany(Category::className(), ['category_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getBookCategory() { return $this->hasOne(Category::className(), ['id' => 'categoryId']); }
public function getCategories() { return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable('post_category', ['post_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getCategory() { return $this->hasOne(Category::className(), ['id' => 'Category_id']); }
public function getCategory() { return $this->hasOne(Category::className(), ['id' => 'category_id'])->via('advert'); }
/** * @return $this */ public function getCategories() { return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(BooksCategories::tableName(), ['book_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getCategoryItem() { return $this->hasOne(Category::className(), ['ID' => 'category']); }