Exemplo n.º 1
0
Arquivo: enum.php Projeto: vitch/sprig
 public function __construct(array $options = NULL)
 {
     parent::__construct($options);
     if (empty($this->choices)) {
         throw new Sprig_Exception('Enum fields must declare the available choices');
     }
 }
Exemplo n.º 2
0
 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), '/') . '/';
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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;
     }
 }