Overview

Packages

  • Auth
  • Config
  • Controller
  • Date
  • Db
  • Feed
    • Abstract
    • Writers
  • File
    • Decorator
  • Form
    • Element
  • Image
  • Log
    • Writer
  • Net
    • Exception
  • None
  • PHP
  • PHPMailer
  • Session
  • Util
  • Validate
    • Validator
  • Zend
    • Registry

Classes

  • Validate_Abstract
  • Validate_Validate
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Pry Framework
 4:  *
 5:  * LICENSE
 6:  *
 7:  * This source file is subject to the new BSD license that is bundled
 8:  * with this package in the file LICENSE.txt.
 9:  * 
10:  * @version $Revision: 276 $
11:  */
12: 
13: /**
14:  *
15:  * @category Pry
16:  * @package Validate
17:  * @abstract 
18:  * @version 1.0.0 
19:  * @author Olivier ROGER <oroger.fr>
20:  */
21: abstract class Validate_Abstract
22: {
23:     protected $espace;
24:     
25:     protected $errorMsg;
26:     
27:     /**
28:      * Défini le message d'erreur
29:      *
30:      * @param string $message
31:      * @access public
32:      */
33:     public function setMessage($message)
34:     {
35:         $this->errorMsg = $message;
36:     }
37:     
38:     /**
39:      * Retourne l'erreur
40:      *
41:      * @access public
42:      * @return string
43:      */
44:     public function getError()
45:     {
46:         return $this->errorMsg;
47:     }
48:     
49:     /**
50:      * Enlève les accents d'une chaine pour REGEX.
51:      *
52:      * @param string $value
53:      * @access public
54:      * @return string
55:      */
56:     public function cleanString($value)
57:     {
58:         $accent     = array('À','Á','Â','Ã','Ä','Å','à','á','â','ã','ä','å','Ò','Ó','Ô','Õ','Ö','Ø','ò','ó','ô','õ','ö','ø','È','É','Ê','Ë','è','é','ê','ë','Ç','ç','Ì','Í','Î','Ï','ì','í','î','ï','Ù','Ú','Û,','Ü','ù','ú','û','ü','ÿ','Ñ','ñ');
59:         $pasaccent  = array('A','A','A','A','A','A','a','a','a','a','a','a','O','O','O','O','O','O','o','o','o','o','o','o','E','E','E','E','e','e','e','e','C','c','I','I','I','I','i','i','i','i','U','U','U,','U','u','u','u','u','y','N','n');
60:         return str_replace($accent,$pasaccent,$value);
61:     }
62:     
63:     /**
64:      * Validation
65:      *
66:      * @abstract 
67:      * @param string $string
68:      * @return boolean
69:      */
70:     abstract protected function isValid($string);
71: }
72:  ?>
Pry Framework API documentation generated by ApiGen 2.6.1