本文整理汇总了PHP中Zend_CodeGenerator_Php_Docblock::setShortDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_CodeGenerator_Php_Docblock::setShortDescription方法的具体用法?PHP Zend_CodeGenerator_Php_Docblock::setShortDescription怎么用?PHP Zend_CodeGenerator_Php_Docblock::setShortDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_CodeGenerator_Php_Docblock
的用法示例。
在下文中一共展示了Zend_CodeGenerator_Php_Docblock::setShortDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createMethodIsSaved
/**
* @see models_ClassGenerator_Defaults_Interface::createMethodIsSaved
*/
public function createMethodIsSaved()
{
$resultMethod = new Zend_CodeGenerator_Php_Method();
$resultMethod->setName('save');
$resultMethod->setVisibility(Zend_CodeGenerator_Php_Property::VISIBILITY_PUBLIC);
$saArray = $this->getPersistenceInformation()->getSerialAttributes();
if (!empty($saArray)) {
foreach ($saArray as $serialAttribute) {
/* @var $serialAttribute Zend_CodeGenerator_Php_Property */
$body .= 'if($this->$' . $serialAttribute->getName() . '!== null){' . "\n";
$body .= "\t" . 'return false;' . "\n";
$body .= '}' . "\n";
}
}
$body .= 'return true;';
$resultMethod->setBody($body);
$docblock = new Zend_CodeGenerator_Php_Docblock();
$docblock->setShortDescription('Returns true if the object is saved (must not be current state) persistent in the database.');
$docblock->setTags(array('return', Zend_CodeGenerator_Php_Property_DefaultValue::TYPE_BOOL));
$resultMethod->setDocblock($docblock);
$this->getClass()->setMethod($resultMethod);
}
示例2: testShortDescriptionGetterAndSetter
public function testShortDescriptionGetterAndSetter()
{
$this->_docblock->setShortDescription('Short Description');
$this->assertEquals('Short Description', $this->_docblock->getShortDescription());
}