/** * @return Form **/ private function checkImportResult(BasePrimitive $prm, $result) { if ($prm instanceof PrimitiveAlias && $result !== null) { $this->markGood($prm->getInner()->getName()); } $name = $prm->getName(); if (null === $result) { if ($prm->isRequired()) { $this->errors[$name] = self::MISSING; } } elseif (true === $result) { unset($this->errors[$name]); } elseif ($error = $prm->getCustomError()) { $this->errors[$name] = $error; } else { $this->errors[$name] = self::WRONG; } return $this; }
/** * @return Form **/ public function set(BasePrimitive $prm) { $this->primitives[$prm->getName()] = $prm; return $this; }