| Total Complexity | 7 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class InterfaceTest extends Model |
||
| 12 | { |
||
| 13 | public $class; |
||
| 14 | public $id; |
||
| 15 | |||
| 16 | public function rules() |
||
| 20 | ]; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function save() |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | public function getModel() |
||
| 34 | { |
||
| 35 | try { |
||
| 36 | return call_user_func("{$this->class}::findOne", $this->id); |
||
| 37 | } catch (\Exception $e) { |
||
| 38 | return null; |
||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param $class |
||
| 44 | * @return InterfaceTest|mixed |
||
| 45 | */ |
||
| 46 | public static function findByClass($class) |
||
| 52 | } |
||
| 53 | } |
||
| 54 | } |