本文整理匯總了PHP中Doctrine_Connection::quoteIdentifier方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Connection::quoteIdentifier方法的具體用法?PHP Doctrine_Connection::quoteIdentifier怎麽用?PHP Doctrine_Connection::quoteIdentifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine_Connection
的用法示例。
在下文中一共展示了Doctrine_Connection::quoteIdentifier方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: applyInheritance
/**
* applyInheritance
* applies column aggregation inheritance to DQL / SQL query
*
* @return string
*/
public function applyInheritance()
{
// get the inheritance maps
$array = array();
foreach ($this->_aliasMap as $componentAlias => $data) {
$tableAlias = $this->getTableAlias($componentAlias);
$array[$tableAlias][] = $data['table']->inheritanceMap;
}
// apply inheritance maps
$str = '';
$c = array();
$index = 0;
foreach ($array as $tableAlias => $maps) {
$a = array();
// don't use table aliases if the query isn't a select query
if ($this->type !== Doctrine_Query::SELECT) {
$tableAlias = '';
} else {
$tableAlias .= '.';
}
foreach ($maps as $map) {
$b = array();
foreach ($map as $field => $value) {
$identifier = $this->_conn->quoteIdentifier($tableAlias . $field);
if ($index > 0) {
$b[] = '(' . $identifier . ' = ' . $value . ' OR ' . $identifier . ' IS NULL)';
} else {
$b[] = $identifier . ' = ' . $value;
}
}
if (!empty($b)) {
$a[] = implode(' AND ', $b);
}
}
if (!empty($a)) {
$c[] = implode(' AND ', $a);
}
$index++;
}
$str .= implode(' AND ', $c);
return $str;
}