| Total Complexity | 9 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Model_Base { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var array |
||
| 15 | */ |
||
| 16 | protected $_extra_args; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Model_Base constructor. |
||
| 20 | * |
||
| 21 | * @param array $args |
||
| 22 | */ |
||
| 23 | 10 | public function __construct( $args = array() ) { |
|
| 30 | |||
| 31 | } |
||
| 32 | |||
| 33 | 10 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $property |
||
| 37 | * @param mixed $value |
||
| 38 | */ |
||
| 39 | 3 | public function set( $property, $value ) { |
|
| 40 | |||
| 41 | do { |
||
| 42 | 3 | if ( property_exists( get_called_class(), "_{$property}" ) ) { |
|
| 43 | 1 | $property = "_{$property}"; |
|
| 44 | 1 | $this->{$property} = $value; |
|
| 45 | 1 | break; |
|
| 46 | } |
||
| 47 | |||
| 48 | 3 | $this->_extra_args[ $property ] = $value; |
|
| 49 | 3 | } while ( false ); |
|
| 50 | |||
| 51 | 3 | } |
|
| 52 | |||
| 53 | /** |
||
| 54 | * @param string $method_name |
||
| 55 | * @param array $args |
||
| 56 | * |
||
| 57 | * @return mixed|null |
||
| 58 | */ |
||
| 59 | 16 | public function __call( $method_name, $args ) { |
|
| 77 | |||
| 78 | } |
||
| 81 |