コード例 #1
0
ファイル: Class.php プロジェクト: vinnivinsachi/Vincent-DR
 /**
  * Add a method definition to the class
  *
  * @param object class method object
  */
 function addMethod(CodeGen_PECL_Element_Method $method)
 {
     $name = $method->getName();
     if (isset($this->functions[$name])) {
         return PEAR::raiseError("method '{$name}' already exists");
     }
     $this->methods[$name] = $method;
     return true;
 }
コード例 #2
0
ファイル: Interface.php プロジェクト: hholzgra/CodeGen_PECL
 /**
  * Add a method to the interface
  *
  * @param object
  */
 function addMethod(CodeGen_PECL_Element_Method $method)
 {
     $name = $method->getName();
     if (isset($this->functions[$name])) {
         return PEAR::raiseError("method '{$name}' already exists");
     }
     /* TODO
        if (!$method->isAbstract || !$method->isInterface) {
            return PEAR::raiseError("an interface method has to be declated both abstract and interface");
        }
        */
     $this->methods[$name] = $method;
     return true;
 }