| 1 | <?php |
||
| 11 | class CategoryableRepository extends Repository |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @return Categoryable |
||
| 15 | */ |
||
| 16 | public function getModel() |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param $category |
||
| 23 | * @param $categoryable |
||
| 24 | * @return Categoryable |
||
| 25 | */ |
||
| 26 | public function create($category, $categoryable) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param $id |
||
| 38 | * @return mixed |
||
| 39 | */ |
||
| 40 | public function getByCategoryId($id) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param $product |
||
| 50 | * @param $category_id |
||
| 51 | * @return mixed |
||
| 52 | */ |
||
| 53 | public function getByProductAndCategoryId($product, $category_id) |
||
| 61 | } |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: