本文整理汇总了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));
}