コード例 #1
0
 public function __construct($table, $field, $defaults = [])
 {
     parent::__construct($table, $field);
     $this->defaultValues = ['val' => ''];
     $this->values = ['val' => ''];
     $this->setDefaults($defaults);
 }
コード例 #2
0
 public function __construct($table, $field, $defaults = [], $limits = ['min' => null, 'max' => null])
 {
     parent::__construct($table, $field);
     $this->limits['min'] = is_null($limits['min']) ? null : $limits['min'] * 1;
     $this->limits['max'] = is_null($limits['max']) ? null : $limits['max'] * 1;
     $this->defaultValues = ['min' => $this->limits['min'], 'max' => $this->limits['max']];
     $this->values = ['min' => $this->limits['min'], 'max' => $this->limits['max']];
     $this->setDefaults($defaults);
 }
コード例 #3
0
 public function __construct($table, $field, $searchTable, $defaults = [])
 {
     parent::__construct($table, $field);
     $this->searchTable = $searchTable;
     $search_model = \models\ContentList::getInstance($searchTable);
     $this->defaultValues = ['list' => []];
     $this->values = ['list' => []];
     $this->setDefaults($defaults);
     $this->setItems($search_model->get(0, 1000, false)['subset']);
 }
コード例 #4
0
 public function __construct($table, $field, $allowedValues, $defaults = [])
 {
     parent::__construct($table, $field);
     if (is_array($allowedValue)) {
         $this->allowedValues = $allowedValues;
     } else {
         $this->allowedValues = explode(',', $allowedValues);
     }
     $this->defaultValues = ['list' => []];
     $this->values = ['list' => []];
     $this->setDefaults($defaults);
 }