/** * Methode qui fait les tests sur la $pValue * * @param mixed $pValue La valeur */ public function _validate($pValue) { // Récupération $gender = $this->getParam('gender', null); if ($pValue == '') { return true; } try { CopixFormatter::getNumeroSecuriteSociale(substr($pValue, 0, -2), substr($pValue, -2)); } catch (CopixException $e) { return $e->getMessage(); } if ($gender !== null) { if (!preg_match('/^' . $gender . '/', $pValue)) { return _i18n('copix:copixformatter.error.incorrectdatasecu'); } } return true; }