Esempio n. 1
0
 public function addSetter($name, $phpDoc = true)
 {
     $setter = new ClassFunction('set' . ucwords($name));
     $setter->addInput(new Input($name));
     $setter->addCode(new Code\RawCode('$this->' . $name . ' = ' . $name . ';'));
     $setter->addCode(new Code\ReturnValue('$this'));
     if ($phpDoc) {
         $phpDocItem = new PhpDoc('Sets "' . $name . '" property');
         $phpDocItem->addTag(new Tag\Base('param', ($this->issetProperty($name) ? $this->getProperty($name)->getType() : 'variant') . ' $' . $name));
         $setter->setComment($phpDocItem);
     }
     $this->addFunction($setter);
     return $this;
 }