本文整理匯總了PHP中DatabaseHandler::quoteColumn方法的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseHandler::quoteColumn方法的具體用法?PHP DatabaseHandler::quoteColumn怎麽用?PHP DatabaseHandler::quoteColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DatabaseHandler
的用法示例。
在下文中一共展示了DatabaseHandler::quoteColumn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: removePolicyLimitations
/**
* Remove all limitations for a policy.
*
* @param mixed $policyId
*/
public function removePolicyLimitations($policyId)
{
$query = $this->handler->createSelectQuery();
$query->select($this->handler->aliasedColumn($query, 'id', 'ezpolicy_limitation'), $this->handler->aliasedColumn($query, 'id', 'ezpolicy_limitation_value'))->from($this->handler->quoteTable('ezpolicy'))->leftJoin($this->handler->quoteTable('ezpolicy_limitation'), $query->expr->eq($this->handler->quoteColumn('policy_id', 'ezpolicy_limitation'), $this->handler->quoteColumn('id', 'ezpolicy')))->leftJoin($this->handler->quoteTable('ezpolicy_limitation_value'), $query->expr->eq($this->handler->quoteColumn('limitation_id', 'ezpolicy_limitation_value'), $this->handler->quoteColumn('id', 'ezpolicy_limitation')))->where($query->expr->eq($this->handler->quoteColumn('id', 'ezpolicy'), $query->bindValue($policyId, null, \PDO::PARAM_INT)));
$statement = $query->prepare();
$statement->execute();
$limitationIdsSet = array();
$limitationValuesSet = array();
while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
if ($row['ezpolicy_limitation_id'] !== null) {
$limitationIdsSet[$row['ezpolicy_limitation_id']] = true;
}
if ($row['ezpolicy_limitation_value_id'] !== null) {
$limitationValuesSet[$row['ezpolicy_limitation_value_id']] = true;
}
}
if (!empty($limitationIdsSet)) {
$query = $this->handler->createDeleteQuery();
$query->deleteFrom($this->handler->quoteTable('ezpolicy_limitation'))->where($query->expr->in($this->handler->quoteColumn('id'), array_keys($limitationIdsSet)));
$query->prepare()->execute();
}
if (!empty($limitationValuesSet)) {
$query = $this->handler->createDeleteQuery();
$query->deleteFrom($this->handler->quoteTable('ezpolicy_limitation_value'))->where($query->expr->in($this->handler->quoteColumn('id'), array_keys($limitationValuesSet)));
$query->prepare()->execute();
}
}