示例#1
0
文件: ORM.php 项目: ariol/adminshop
 public function __construct(ORM $model, $name_key = 'name', $id_key = 'id')
 {
     parent::__construct();
     $this->_model = clone $model;
     $this->_name_key = $name_key;
     $this->_id_key = $id_key;
 }
示例#2
0
 public function __construct(array $fields, ORM $model, $name_key = 'name', $id_key = 'id')
 {
     parent::__construct();
     $this->_relation_model = $fields;
     $this->_model = clone $model;
     $this->_name_key = $name_key;
     $this->_id_key = $id_key;
 }
示例#3
0
 public function __construct(array $options = array(), $mode = NULL)
 {
     parent::__construct();
     $this->_mode = $mode;
     if (!empty($options)) {
         $this->set_options($options);
     }
 }
示例#4
0
文件: Array.php 项目: ariol/adminshop
 public function __construct(CM_Field $value_field = NULL)
 {
     if ($this->typeIsDenied($value_field->get_type())) {
         throw new Exception('CM field type is denied: ' . $value_field->get_type());
     }
     parent::__construct();
     if (!is_null($value_field)) {
         $this->set_value_field($value_field);
     }
 }
示例#5
0
 public function __construct()
 {
     $select_options = array();
     foreach ($this->get_allowed_fields() as $group_name => $field_array) {
         if (is_array($field_array)) {
             $select_options[$group_name] = array();
             foreach ($field_array as $field) {
                 $this->_allowed_fields[$field->get_type()] = $field;
                 $select_options[$group_name][$field->get_type()] = $field->get_type_name();
             }
         } else {
             $this->_allowed_fields[$field_array->get_type()] = $field_array;
             $select_options[$field_array->get_type()] = $field_array->get_type_name();
         }
     }
     $type_field = new CM_Field_Select();
     $type_field->set_options($select_options);
     $type_field->set_label('Тип поля');
     $this->_type_field = $type_field;
     parent::__construct();
 }