setSourceDirty(false); return $property; } /** * setConst() * * @param bool $const * @return Zend_CodeGenerator_Php_Property */ public function setConst($const) { $this->_isConst = $const; return $this; } /** * isConst() * * @return bool */ public function isConst() { return ($this->_isConst) ? true : false; } /** * setDefaultValue() * * @param string $defaultValue * @return Zend_CodeGenerator_Php_Property */ public function setDefaultValue($defaultValue) { $this->_defaultValue = $defaultValue; return $this; } /** * getDefaultValue() * * @return string */ public function getDefaultValue() { return $this->_defaultValue; } /** * generate() * * @return string */ public function generate() { $name = $this->getName(); $defaultValue = $this->getDefaultValue(); if ($this->isConst()) { $string = ' ' . 'const ' . $name . ' = \'' . $defaultValue . '\';'; } else { $string = ' ' . $this->getVisibility() . ' $' . $name . ' = ' . ((null !== $defaultValue) ? '\'' . $defaultValue . '\'' : 'null') . ';'; } return $string; } }