zCode = $_zCode ; $this->iType = $_iType ; $this->zPattern = $_zPattern ; $this->zValue = $_zValue ; } /** * V�rificaion de la conformit� interne du champs * * @return bool R�sultat de la v�rification de conformit� */ public function check () { $bRet = true ; if (preg_match ("/^[a-zA-Z0-9_]+$/", $this->zCode) === false) { $bRet = false ; throw new Exception ("[FIELD : " . $this->zCode . "] >> Code de champ incorrect : [" . $this->zCode . "]") ; } if (trim ($this->zPattern) != "") { if (ereg ($this->zPattern, $this->zValue) === false) { $bRet = false ; throw new Exception ("[FIELD : " . $this->zCode . "] >> Valeur de champ incorrect par rapport au motif") ; } } if ($this->iType == FIELDTYPE_LIST) { if (ereg ("^[0-9]+$", $this->zValue) === false) { $bRet = false ; throw new Exception ("[FIELD : " . $this->zCode . "] >> Valeur de champ incorrect pour un type LISTE") ; } } return $bRet ; } } ?>