Example #1
0
 public function render($indent = NULL)
 {
     parent::reset();
     $className = StringUtil::toUpperCamelCase($this->name);
     //class $name extends $extends implements $interfaces
     if ($this->extendsTo && sizeof($this->interfaces)) {
         $header = sprintf('class %s extends %s implements %s', $className, $this->extendsTo, implode(',', $this->interfaces));
         //class $name implements $interfaces
     } elseif (!$this->extendsTo && sizeof($this->interfaces)) {
         $header = sprintf('class %s implements %s ', $className, implode(',', $this->interfaces));
         //class $name extends $extends
     } elseif ($this->extendsTo) {
         $header = sprintf('class %s extends %s ', $className, $this->extendsTo);
         //class $name
     } else {
         $header = sprintf('class %s ', $className);
     }
     $this->setHeader($header);
     foreach ($this->attributes as $key => $attribute) {
         $this->l($attribute);
     }
     foreach ($this->methods as $method) {
         $this->l($method);
     }
     return parent::render($indent);
 }