| 1 | <?php |
||
| 21 | class Row extends \Bluz\Db\Row |
||
| 22 | { |
||
| 23 | use Validator; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Before Insert/Update |
||
| 27 | * |
||
| 28 | * @return void |
||
| 29 | */ |
||
| 30 | protected function beforeInsert() |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Before Update |
||
| 45 | * |
||
| 46 | * @return void |
||
| 47 | */ |
||
| 48 | protected function beforeUpdate() |
||
| 72 | |||
| 73 | /** |
||
| 74 | * isBasic |
||
| 75 | * |
||
| 76 | * @return boolean |
||
| 77 | */ |
||
| 78 | public function isBasic() : bool |
||
| 82 | } |
||
| 83 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.