Back to index

php5  5.3.10
gtIsValidMethod.php
Go to the documentation of this file.
00001 <?php
00002 
00007 class gtIsValidMethod extends gtPreCondition {
00008 
00009  public function check( $clo) {
00010     if($clo->hasOption('m') ) {
00011       $className = $clo->getOption('c');
00012       $class = new ReflectionClass($className);
00013       $methods = $class->getMethods();
00014       foreach($methods as $method) {
00015         if($clo->getOption('m') == $method->getName()) {
00016           return true;
00017         }
00018       }
00019       return false;
00020     }
00021     return true;
00022   }
00023 
00024   public function getMessage() {
00025     return gtText::get('unknownMethod');
00026   }
00027 }
00028 ?>