public function __construct(array $options = NULL) { parent::__construct($options); if (empty($this->choices)) { throw new Sprig_Exception('Enum fields must declare the available choices'); } }
public function __construct(array $options = NULL) { if (empty($options['path']) or !is_dir($options['path'])) { throw new Sprig_Exception('Image fields must have a directory path to save and load images from'); } parent::__construct($options); // Make sure the path has a trailing slash $this->path = rtrim(str_replace('\\', '/', $this->path), '/') . '/'; }
public function __construct(array $options = NULL) { if (empty($options['directory']) or !is_dir($options['directory'])) { throw new Sprig_Exception('Image fields must define a directory path'); } // Normalize the directory path $options['directory'] = rtrim(str_replace(array('\\', '/'), '/', $options['directory']), '/') . '/'; parent::__construct($options); }
public function __construct(array $options = NULL) { parent::__construct($options); if ($this->empty or $this->prompt) { Arr::unshift($this->codes, '', $this->prompt); } if (!$this->choices) { $this->choices = $this->codes; } }