public function __construct($table, $field, $defaults = []) { parent::__construct($table, $field); $this->defaultValues = ['val' => '']; $this->values = ['val' => '']; $this->setDefaults($defaults); }
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); }
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']); }
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); }