本文整理汇总了PHP中Zend_Db_Table_Abstract::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Table_Abstract::update方法的具体用法?PHP Zend_Db_Table_Abstract::update怎么用?PHP Zend_Db_Table_Abstract::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Db_Table_Abstract
的用法示例。
在下文中一共展示了Zend_Db_Table_Abstract::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
public function update($id, $state, $info)
{
$data = array('state' => $state, 'info' => $info, 'lastupdate' => time());
$found = $this->find($id);
if ($found) {
$data = array_merge($found, $data);
unset($data['id']);
$this->dbTable->update($data, array('id = ?' => $id));
} else {
$data['id'] = $id;
$data['sticked'] = 0;
$this->dbTable->insert($data);
}
}
示例2: update
public function update(array $data, $where)
{
if (!isset($data['updated_at'])) {
$data['updated_at'] = date('Y-m-d H:i:s');
}
return parent::update($data, $where);
}
示例3: updateProfile
public function updateProfile($data, $user_id)
{
$value['first_name'] = $data['first_name'];
$value['middle_name'] = $data['middle_name'];
$value['last_name'] = $data['last_name'];
return parent::update($value, array('user_id = ?' => $user_id));
}
示例4: updateStatus
public function updateStatus($status, $id)
{
foreach ($status as $key => $val) {
$data[$key] = $val;
}
return parent::update($data, array('user_id = ?' => $id));
}
示例5: update
public function update(array $data, $where)
{
if (empty($data['updated_at'])) {
$data['updated_at'] = new Zend_Db_Expr('NOW()');
}
return parent::update($data, $where);
}
示例6: update
public function update($data, $where)
{
parent::update($data, $where);
$this->where = $where;
$this->data = $data;
$this->_notifyObservers("update");
}
示例7: update
public function update(array $data, $where)
{
$data = $this->filter($data);
if (count($data) <= 0) {
return false;
}
return parent::update($data, $where);
}
示例8: changeGroupadminUsername
public function changeGroupadminUsername($old_group_identifier, $group_identifier, $user_id)
{
$old_username = $old_group_identifier . '_group';
$data['user_name'] = $group_identifier . '_group';
parent::update($data, array('user_name = ?' => $old_username));
$userGroupModel = new User_Model_DbTable_UserGroup();
$userGroupModel->updateUsername($group_identifier, $user_id);
}
示例9: _update
/**
* Update DB row with data
*
* @param mixed $id ''
* @param array $data ''
* @return void
* @throws Zend_Exception if row cannot be updated
*/
private function _update($id, $data)
{
try {
$stmt = $this->_getWhereStatement($id);
$this->obj->update($data, $stmt);
} catch (\Zend_Exception $e) {
throw $e;
}
}
示例10: updates
public function updates($id, $titulo, $comentario, $noticia, $foto, $data, $fonte, $ativo, $categoria_noticia_id)
{
try {
$data = array('titulo' => $titulo, 'comentario' => $comentario, 'noticia' => $noticia, 'foto' => $foto, 'fonte' => $fonte, 'ativo' => $ativo, 'categoria_noticia_id' => $categoria_noticia_id);
parent::update($data, 'id = ' . (int) $id);
} catch (Exception $e) {
echo 'Opa... algum problema aconteceu.';
}
}
示例11: updates
public function updates($id, $titulo, $comentario, $entrevista, $foto, $data, $entrevistado, $reporter, $ativo)
{
try {
$dados = array('titulo' => $titulo, 'comentario' => $comentario, 'entrevista' => $entrevista, 'foto' => $foto, 'data' => $data, 'entrevistado' => $entrevistado, 'reporter' => $reporter, 'ativo' => $ativo);
parent::update($dados, 'id = ' . (int) $id);
} catch (Exception $e) {
echo 'Opa... algum problema aconteceu.';
}
}
示例12: update
public function update(array $data, $where)
{
// хешируем пароль
if (isset($data['password'])) {
$data['salt'] = $salt = self::generateSalt();
$data['password'] = self::getPasswordHash($data['password'], $salt);
}
return parent::update($data, $where);
}
示例13: updateNode
/**
* updateNode
* @param array $arrUpdateData
* @author Thomas Schedler <tsh@massiveart.com>
* @version 1.0
*/
private function updateNode($arrUpdateData)
{
try {
$strWhere = $this->objTable->getAdapter()->quoteInto('id = ?', $this->intNodeId);
$this->objTable->update($arrUpdateData, $strWhere);
} catch (Exception $exc) {
$this->core->logger->err($exc);
}
}
示例14: update
public function update(array $data, $where)
{
$data['updatedDate'] = date("Y-m-d h:i:s");
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$userName = $auth->getIdentity()->username;
$data['updatedBy'] = $userName;
}
return parent::update($data, $where);
}
示例15: setApplicationState
/**
* set application state
*
* @param array $_applicationIds application ids to set new state for
* @param string $_state the new state
* @throws Tinebase_Exception_InvalidArgument
*/
public function setApplicationState(array $_applicationIds, $_state)
{
if ($_state != Tinebase_Application::DISABLED && $_state != Tinebase_Application::ENABLED) {
throw new Tinebase_Exception_InvalidArgument('$_state can be only Tinebase_Application::DISABLED or Tinebase_Application::ENABLED');
}
$where = array($this->_db->quoteInto($this->_db->quoteIdentifier('id') . ' IN (?)', $_applicationIds));
$data = array('status' => $_state);
$affectedRows = $this->_applicationTable->update($data, $where);
$this->_cleanCache();
//error_log("AFFECTED:: $affectedRows");
}