Пример #1
0
 protected function initTimeIsOptional(ComponentsValidator $validator)
 {
     if (!isset($this->timeIsOptionalComponentName)) {
         $this->timeIsOptional = FALSE;
     } else {
         $booleanComponent = $validator->getComponentByFormName($this->timeIsOptionalComponentName);
         $validator->validateComponent($booleanComponent);
         $this->timeIsOptional = $booleanComponent->getFormValue();
     }
 }
Пример #2
0
 public function onValidation(\Psc\Form\ComponentsValidator $validator)
 {
     // dependency zu yearKnown
     $this->setYearKnown($validator->validateComponent($validator->getComponentByFormName('yearKnown'))->getFormValue());
 }
Пример #3
0
 protected function initComponentsValidator(\Psc\Form\ComponentsValidator $componentsValidator)
 {
     foreach ($this->optionalProperties as $property) {
         $componentsValidator->setOptional($property);
     }
 }
Пример #4
0
 public function onPostValidation(ComponentsValidator $validator, \Closure $do)
 {
     $entity = $this->validationEntity;
     $validator->addPostValidation(new \Psc\Code\Callback(function ($componentsValidator, $validatedComponents) use($entity, $do) {
         $do($entity, $componentsValidator, $validatedComponents);
     }));
 }