public function getParent() { return $this->hasOne(Category::className(), ['id' => 'parent_id']); }
public function getCategories() { return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable('{{%shop_product_to_category}}', ['product_id' => 'id']); }