*/ /** * Klasa stAllegroDeliveryValidator * * @package stAllegroPlugin * @subpackage libs */ class stIfirmaValidator extends sfValidator { /** * Wykonuje sprawdzanie * * @param object $value * @param object $error * @return boolean */ public function execute (&$value, &$error) { $config = $this->getContext()->getRequest()->getParameter('config',null); $rsp = stIfirmaListener::registerUser($config); if ($rsp['response']['Kod']>0) { $error = $rsp['response']['Informacja']; return false; } return true; } /** * Inicjalizacja validatora * * @param object $context * @param array $parameters * @return boolean */ public function initialize ($context, $parameters = null) { // Initialize parent parent::initialize($context); // Set default parameters value $this->setParameter('register_error', 'Błąd podczas rejestracji.'); // Set parameters $this->getParameterHolder()->add($parameters); return true; } } ?>