示例#1
0
 protected function populateRecord(Element $element)
 {
     $name = $element->getName();
     if ($name && $this->record->hasKey($name)) {
         if (!in_array($element->getAttribute('type'), ['file', 'password'])) {
             $this->record->{$name} = $element->getValue();
         }
     }
 }
 /**
  * @param Element $element
  * @param         $args
  *
  * @return bool
  */
 public function validate(Element $element, $args)
 {
     $this->errors = [];
     $this->value = $element->getValue();
     foreach ($this->arrBitwise as $bitwise => $arrBitwise) {
         if ($this->bitwise & $bitwise) {
             if (!$this->{'validate' . $arrBitwise['function']}()) {
                 $this->addMsg($arrBitwise['msg']);
             }
         }
     }
     return !$this->errors;
 }