本文整理匯總了PHP中DatabaseHandler::getSequenceName方法的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseHandler::getSequenceName方法的具體用法?PHP DatabaseHandler::getSequenceName怎麽用?PHP DatabaseHandler::getSequenceName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DatabaseHandler
的用法示例。
在下文中一共展示了DatabaseHandler::getSequenceName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addPolicyLimitations
/**
* Adds limitations to an existing policy.
*
* @param int $policyId
* @param array $limitations
*/
public function addPolicyLimitations($policyId, array $limitations)
{
foreach ($limitations as $identifier => $values) {
$query = $this->handler->createInsertQuery();
$query->insertInto($this->handler->quoteTable('ezpolicy_limitation'))->set($this->handler->quoteColumn('id'), $this->handler->getAutoIncrementValue('ezpolicy_limitation', 'id'))->set($this->handler->quoteColumn('identifier'), $query->bindValue($identifier))->set($this->handler->quoteColumn('policy_id'), $query->bindValue($policyId, null, \PDO::PARAM_INT));
$query->prepare()->execute();
$limitationId = $this->handler->lastInsertId($this->handler->getSequenceName('ezpolicy_limitation', 'id'));
foreach ($values as $value) {
$query = $this->handler->createInsertQuery();
$query->insertInto($this->handler->quoteTable('ezpolicy_limitation_value'))->set($this->handler->quoteColumn('id'), $this->handler->getAutoIncrementValue('ezpolicy_limitation_value', 'id'))->set($this->handler->quoteColumn('value'), $query->bindValue($value))->set($this->handler->quoteColumn('limitation_id'), $query->bindValue($limitationId, null, \PDO::PARAM_INT));
$query->prepare()->execute();
}
}
}