Guest User

Untitled

a guest
Jan 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. class BaseClass {
  2. public static $definition = array(
  3. 'id' => array(type => 'int', 'required' => true),
  4. 'field1' => array(type => 'string', 'required' => true),
  5. 'field2' => array(type => 'bool', 'required' => true),
  6. // и еще 100500 элементов
  7. );
  8. }
  9.  
  10. class ChildClass extends BaseClass {
  11. public static $definition = array(
  12. 'id' => array(type => 'int', 'required' => true),
  13. 'field1' => array(type => 'string', 'required' => false), // единственное изменение
  14. 'field2' => array(type => 'bool', 'required' => true),
  15. // и еще 100500 элементов без изменений
  16. );
  17. }
  18.  
  19. class ChildClass extends BaseClass {
  20. // да да, так нельзя, я знаю :)
  21. public static $definition['field1']['required'] = true;
  22. }
Add Comment
Please, Sign In to add comment