Changeset 3138 for trunk/lib/Doctrine.php
- Timestamp:
- 11/11/07 00:51:13 (14 months ago)
- Files:
-
- 1 modified
-
trunk/lib/Doctrine.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Doctrine.php
r3127 r3138 442 442 * Array of all the loaded models and the path to each one for autoloading 443 443 * 444 * @var string444 * @var array 445 445 */ 446 446 private static $_loadedModels = array(); 447 448 /** 449 * _validators 450 * 451 * Array of all the loaded validators 452 * @var array 453 */ 454 private static $_validators = array(); 447 455 448 456 /** … … 1071 1079 } 1072 1080 1073 function removeDirectories($folderPath) 1081 /** 1082 * removeDirectories 1083 * 1084 * @param string $folderPath 1085 * @return void 1086 */ 1087 public static function removeDirectories($folderPath) 1074 1088 { 1075 1089 if (is_dir($folderPath)) … … 1094 1108 } 1095 1109 } 1110 1111 /** 1112 * getValidators 1113 * 1114 * Get available doctrine validators 1115 * 1116 * @return array $validators 1117 */ 1118 public static function getValidators() 1119 { 1120 if (empty(self::$_validators)) { 1121 $dir = Doctrine::getPath() . DIRECTORY_SEPARATOR . 'Doctrine' . DIRECTORY_SEPARATOR . 'Validator'; 1122 1123 $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY); 1124 foreach ($files as $file) { 1125 $e = explode('.', $file->getFileName()); 1126 1127 if (end($e) == 'php') { 1128 $name = strtolower($e[0]); 1129 1130 self::$_validators[$name] = $name; 1131 } 1132 } 1133 } 1134 1135 return self::$_validators; 1136 } 1096 1137 }