本文整理匯總了PHP中Zend_Db_Adapter_Pdo_Mysql::quoteInto方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Db_Adapter_Pdo_Mysql::quoteInto方法的具體用法?PHP Zend_Db_Adapter_Pdo_Mysql::quoteInto怎麽用?PHP Zend_Db_Adapter_Pdo_Mysql::quoteInto使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Db_Adapter_Pdo_Mysql
的用法示例。
在下文中一共展示了Zend_Db_Adapter_Pdo_Mysql::quoteInto方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addSingleRight
/**
* add single role rights
*
* @param int $_roleId
* @param int $_applicationId
* @param string $_right
*/
public function addSingleRight($_roleId, $_applicationId, $_right)
{
// check if already in
$select = $this->_roleRightsTable->select();
$select->where($this->_db->quoteInto($this->_db->quoteIdentifier('role_id') . ' = ?', $_roleId))->where($this->_db->quoteInto($this->_db->quoteIdentifier('right') . ' = ?', $_right))->where($this->_db->quoteInto($this->_db->quoteIdentifier('application_id') . ' = ?', $_applicationId));
if (!($row = $this->_roleRightsTable->fetchRow($select))) {
$data = array('role_id' => $_roleId, 'application_id' => $_applicationId, 'right' => $_right);
$this->_roleRightsTable->insert($data);
}
}
示例2: getContexts
/**
* returns all contexts of a given tag
*
* @param string $_tagId
* @return array array of application ids
*/
public function getContexts($_tagId)
{
$select = $this->_db->select()->from(array('tags_context' => SQL_TABLE_PREFIX . 'tags_context'), array('application_id' => $this->_dbCommand->getAggregate('application_id')))->where($this->_db->quoteInto($this->_db->quoteIdentifier('tag_id') . ' = ?', $_tagId))->group('tag_id');
Tinebase_Backend_Sql_Abstract::traitGroup($select);
$apps = $this->_db->fetchOne($select);
if ($apps === '0') {
$apps = 'any';
}
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' got tag contexts: ' . $apps);
}
return explode(',', $apps);
}
示例3: quoteInto
/**
* Quotes a value and places into a piece of text at a placeholder.
*
* Method revrited for handle empty arrays in value param
*
* @param string $text The text with a placeholder.
* @param mixed $value The value to quote.
* @param string $type OPTIONAL SQL datatype
* @param integer $count OPTIONAL count of placeholders to replace
* @return string An SQL-safe quoted value placed into the orignal text.
*/
public function quoteInto($text, $value, $type = null, $count = null)
{
if (is_array($value) && empty($value)) {
$value = new Zend_Db_Expr('NULL');
}
return parent::quoteInto($text, $value, $type, $count);
}
示例4: quoteInto
/**
* Quotes a value and places into a piece of text at a placeholder.
*
* Method revrited for handle empty arrays in value param
*
* @param string $text The text with a placeholder.
* @param mixed $value The value to quote.
* @param string $type OPTIONAL SQL datatype
* @param integer $count OPTIONAL count of placeholders to replace
* @return string An SQL-safe quoted value placed into the orignal text.
*/
public function quoteInto($text, $value, $type = null, $count = null)
{
if (is_array($value) && empty($value)) {
$value = new \Zend_Db_Expr('NULL');
}
if ($value instanceof \DateTimeInterface) {
$value = $value->format('Y-m-d H:i:s');
}
return parent::quoteInto($text, $value, $type, $count);
}
示例5: deleteNoteType
/**
* delete note type
*
* @param integer $_noteTypeId
*/
public function deleteNoteType($_noteTypeId)
{
$this->_noteTypesTable->delete($this->_db->quoteInto($this->_db->quoteIdentifier('id') . ' = ?', $_noteTypeId));
}