/** * Methode qui fait les tests sur la $pValue * * @param mixed $pValue La valeur */ public function _validate($pValue) { // Récupération $telKind = $this->getParam('kind', null); try { CopixFormatter::getTelephone($pValue); } catch (CopixException $e) { return $e->getMessage(); } switch ($telKind) { case 'mobile': if (!preg_match('/^06/', $pValue)) { return _i18n('copix:copixformatter.error.badmobile'); } break; case 'international': if (!preg_match('/^00/', $pValue)) { return _i18n('copix:copixformatter.error.badtel'); } break; } return true; }