Exemplo n.º 1
0
 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']);
 }
Exemplo n.º 3
0
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ["cid" => "cid"]);
 }
Exemplo n.º 4
0
 public function getCategories()
 {
     return $this->hasOne(Category::className(), ['id' => 'category']);
 }
Exemplo n.º 5
0
 /**
  * @return CategoryQuery
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['CategoryID' => 'CategoryID'])->inverseOf('products');
 }
Exemplo n.º 6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getChildren()
 {
     return $this->hasMany(Category::className(), ['parent_id' => 'id']);
 }
Exemplo n.º 7
0
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['category_id' => 'id']);
 }
Exemplo n.º 8
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBookCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'categoryId']);
 }
Exemplo n.º 9
0
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable('post_category', ['post_id' => 'id']);
 }
Exemplo n.º 10
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'Category_id']);
 }
Exemplo n.º 11
0
 public function getCategory()
 {
     return $this->hasOne(Category::className(), ['id' => 'category_id'])->via('advert');
 }
Exemplo n.º 12
0
 /**
  * @return $this
  */
 public function getCategories()
 {
     return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(BooksCategories::tableName(), ['book_id' => 'id']);
 }
Exemplo n.º 13
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategoryItem()
 {
     return $this->hasOne(Category::className(), ['ID' => 'category']);
 }