| Total Complexity | 4 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | class DbModel extends Model |
||
| 21 | { |
||
| 22 | // Static Protected Methods |
||
| 23 | // ========================================================================= |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Remove any properties that don't exist in the model |
||
| 27 | * |
||
| 28 | * @param string $class |
||
| 29 | * @param array $config |
||
| 30 | */ |
||
| 31 | protected static function cleanProperties(string $class, array &$config) |
||
| 32 | { |
||
| 33 | foreach ($config as $propName => $propValue) { |
||
| 34 | if (!property_exists($class, $propName)) { |
||
| 35 | unset($config[$propName]); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | // Public Methods |
||
| 41 | // ========================================================================= |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @inheritdoc |
||
| 45 | */ |
||
| 46 | public function __construct(array $config = []) |
||
| 51 | } |
||
| 52 | } |
||
| 53 |