本文整理汇总了PHP中Propel\Runtime\ActiveQuery\Criteria::getComment方法的典型用法代码示例。如果您正苦于以下问题:PHP Criteria::getComment方法的具体用法?PHP Criteria::getComment怎么用?PHP Criteria::getComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Runtime\ActiveQuery\Criteria
的用法示例。
在下文中一共展示了Criteria::getComment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDeleteFromClause
/**
* Returns the "DELETE FROM <table> [AS <alias>]" part of DELETE query.
*
* @param Criteria $criteria
* @param string $tableName
*
* @return string
*/
public function getDeleteFromClause(Criteria $criteria, $tableName)
{
$sql = 'DELETE ';
if ($queryComment = $criteria->getComment()) {
$sql .= '/* ' . $queryComment . ' */ ';
}
if ($realTableName = $criteria->getTableForAlias($tableName)) {
if ($this->useQuoteIdentifier()) {
$realTableName = $this->quoteIdentifierTable($realTableName);
}
$sql .= $tableName . ' FROM ' . $realTableName . ' AS ' . $tableName;
} else {
if ($this->useQuoteIdentifier()) {
$tableName = $this->quoteIdentifierTable($tableName);
}
$sql .= 'FROM ' . $tableName;
}
return $sql;
}
示例2: testComment
public function testComment()
{
$c = new Criteria();
$this->assertNull($c->getComment(), 'Comment is null by default');
$c2 = $c->setComment('foo');
$this->assertEquals('foo', $c->getComment(), 'Comment is set by setComment()');
$this->assertEquals($c, $c2, 'setComment() returns the current Criteria');
$c->setComment();
$this->assertNull($c->getComment(), 'Comment is reset by setComment(null)');
}