Пример #1
0
 protected function prep_props(array $props)
 {
     // Skip tree fields and primary keys
     $skip_fields = \Arr::merge(Model_Menu::primary_key(), Model_Menu::tree_config(), array('children'));
     \Arr::delete($skip_fields, array('read-only', 'title_field'));
     // Model properties
     $properties = \Arr::filter_keys($props, array_keys(Model_Menu::properties()));
     $properties = \Arr::filter_keys($properties, $skip_fields, true);
     //Model 'fields' property fields
     $fields = \Arr::filter_keys($props, array_keys($properties), true);
     $fields = \Arr::filter_keys($fields, $skip_fields, true);
     is_array($properties['fields']) or $properties['fields'] = array();
     $properties['fields'] = \Arr::merge($properties['fields'], $fields);
     return $properties;
 }