示例#1
0
文件: File.php 项目: sqrt-pro/form
 /**
  * На валидацию принимается объект File или null
  *
  * @throws Exception
  */
 public function validate($value)
 {
     if ($value && !$value instanceof \Symfony\Component\HttpFoundation\File\File) {
         Exception::ThrowError(Exception::VALUE_IS_NOT_FILE);
     }
     return parent::validate($value);
 }
示例#2
0
文件: Form.php 项目: sqrt-pro/form
 /** @return static */
 public function add(Element $element)
 {
     $this->fields[$element->getField()] = $element;
     return $this;
 }