![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mautic.corals.io/app/bundles/FormBundle/Event/ |
<?php namespace Mautic\FormBundle\Event; use Mautic\CoreBundle\Event\CommonEvent; use Mautic\FormBundle\Entity\Field; class ValidationEvent extends CommonEvent { private bool $valid = true; private string $invalidReason = ''; /** * @param mixed $value */ public function __construct( private Field $field, private $value ) { } /** * @return Field */ public function getField() { return $this->field; } /** * @return mixed */ public function getValue() { return $this->value; } public function failedValidation($reason): void { $this->valid = false; $this->invalidReason = $reason; $this->stopPropagation(); } /** * Is the field valid. */ public function isValid(): bool { return $this->valid; } /** * Get the reason this field was invalidated. */ public function getInvalidReason(): string { return $this->invalidReason; } }