本文整理匯總了PHP中type::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::delete方法的具體用法?PHP type::delete怎麽用?PHP type::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::delete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete
/**
*
* @param type $id
*/
public function delete($id)
{
try {
$this->repository->delete($id);
} catch (\Exception $e) {
return ['error' => 'true', 'messege' => "Produto não encontrado!"];
}
}
示例2: delete
/**
* Generic method to delete any album
*
* @param type $id
*
* @return type
*/
function delete($id)
{
/* action to perform any task befor deleting an album */
do_action('rtmedia_before_delete_album', $this);
/**
* First fetch all the media from that album
*/
add_filter('rt_db_model_per_page', array($this, 'set_queries_per_page'), 10, 2);
$page = 1;
$flag = true;
/**
* Delete each media from the album first
*/
while ($media = $this->media->model->get_by_album_id($id, $page)) {
$media_id = $media['result'][0]['media_id'];
$flag = wp_delete_attachment($media_id);
if (!$flag) {
break;
}
$page++;
}
/**
* If all the media are deleted from the album then delete the album at last.
*/
if ($flag) {
$this->media->delete($id);
}
/* action to perform any task after deleting an album */
do_action('rtmedia_after_delete_album', $this);
return $flag;
}
示例3: delete
/**
* Delete
*
* @return type
*/
public function delete()
{
if (is_array($this->primaryKey)) {
// @todo compound primary keys
}
$where = array($this->primaryKey => $this->originalData[$this->primaryKey]);
return $this->tableGateway->delete($where);
}
示例4: erase
/**
* Erase value of key
* @param type $key
* @return \Framework\Cache\Driver\Memcached
* @throws Exception\Service
*/
public function erase($key)
{
if (!$this->_isValidService()) {
throw new Exception\Service("Not connected to a valid service");
}
$this->_service->delete($key);
return $this;
}
示例5: destroy
/**
*
* @param type $id
*/
public function destroy($id)
{
$produto = $this->service->show($id);
if ($produto['error']) {
return redirect($this->url)->with("danger", $produto['messege']);
}
$this->service->delete($id);
return redirect($this->url)->with("success", "Produto excluido!");
}
示例6: destroy
/**
*
* @param type $id
*/
public function destroy($id)
{
$cliente = $this->service->show($id);
if ($cliente['error']) {
return redirect($this->url)->with("danger", $cliente['messege']);
}
$this->service->delete($id);
return redirect($this->url)->with("success", "Cliente excluido!");
}
示例7: destroy
/**
*
* @param type $id
*/
public function destroy($id)
{
$fornecedor = $this->service->show($id);
if ($fornecedor['error']) {
return redirect($this->url)->with("danger", $fornecedor['messege']);
}
$this->service->delete($id);
return redirect($this->url)->with("success", "Fornecedor excluido!");
}
示例8: delete
/**
* 刪除數據
* $whereData說明:支持k、v、s的數組結構,
* 例如:$whereData = array(
* array('k'=>'shopId','v'=>1,'s'=>'='),
* array('k'=>'orderStatus','v'=>'waitpay','s'=>'='),
* array('k'=>'createdTime','v'=>'1365389457','s'=>'>='),
* )
* 默認數組元素之間的關係為AND關係,牽涉到具體規則按相應規則處理,規則如下:
* 1、若$whereData為以為數組,數組元素的鍵為屬性名,則鍵值對之間的關係為“=”,數組元素之間的關係為AND關係.
* 例如:$whereData = array('shopId'=>1,'shopName'=>'kongfz'),則where條件為 shopId=1 && shopName='kongfz'
*
* 2、若$whereData為二維數組,數組元素的鍵為屬性名,值為數組,則鍵值對之間的關係為IN關係。
* 例如:$whereData = array('shopId'=>array(1,2,3,..)),則where條件為 shopId in (1,2,3,..)
*
* 3、若$whereData中的數組元素的鍵為OR,則值必須包括兩個及以上的數組,數組之間為OR關係;
* 例如:$whereData = array('shopId'=>1,
* 'OR'=>array('orderStatus'=>'waitSellerConfirmed','orderStatus'=>'waitPay')
* ),
* 則where條件之間的關係為:shopId=1 && (orderStatus='waitSellerConfirmed' && orderStatus='waitPay')
*
* 4、若$whereData為一維數組,且各個鍵為k、v、s,則where條件之間的關係是:$whereData['k']. $whereData['s']. $whereData['v']
* 例如:$whereData = array('k'=>'shopName','v'=>'%kongfz%','s'=>'like'),
* 則where條件之間的關係為:shopName like '%kongfz%'
*
* 5、若$whereData為二維數組,且一維數組的鍵k、v、s,$whereData['s'] = 'IN',$whereData['v']為一維數組,
* 則其關係為$whereData['k'] IN (implode(',',$whereData['v'])),
* 例如:$whereData = array('k'='shopId','v'=>array(1,2,3,..),'s'=>'IN'),
* 則其關係為shopId IN (1,2,3,...)
*
* 6、若$whereData 為多維數組,且數組都是滿足k、v、s的數組結構,
* 例如:$whereData = array(
* array('k'=>'shopId','v'=>1,'s'=>'='),
* array('k'=>'orderStatus','v'=>'waitpay','s'=>'='),
* array('k'=>'createdTime','v'=>'1365389457','s'=>'>='),
* ),
* 則where條件之間的關係為:shopId=1 && orderStatus='waitpay' && createdTime>='1365389457'
* @param array $whereData 一維數組或k、v、s結構組成的數組。一維數組元素之間為and關係,鍵和值為等於關係;k、v、s結構數組,k:屬性名,v:屬性值,s:屬性名和屬性值之間的操作符
* @param string $table 刪除數據的表,若為空,從默認表中刪除數據
* @param boolean $isReturnAffectedRows 是否返回刪除記錄的條數,默認是不返回
* @return boolean
*/
public function delete(array $whereData, $table = '', $isReturnAffectedRows = false)
{
if (is_null($this->db)) {
$this->db = \Util\Db\Manager::getInstance($this->dbName);
}
//如果方法中沒傳遞表名,則向默認表中插入數據
$table = is_string($table) && $table != '' ? $table : $this->defaultTable;
$state = $this->db->delete($table, $whereData);
if ($isReturnAffectedRows && $state) {
return $this->db->getAffectedRows();
}
return $state;
}
示例9: disable_page
/**
* Desactiva una página/controlador.
* @param type $page
*/
private function disable_page($page)
{
if ($page->name == $this->page->name) {
$this->new_error_msg("No puedes desactivar esta página (" . $page->name . ").");
} else {
if (!$page->delete()) {
$this->new_error_msg('Imposible eliminar la página ' . $page->name . '.');
}
}
}
示例10: destroy
/**
*
* @param type $id
*/
public function destroy($id)
{
$this->service->delete($id);
}
示例11: deleteUser
/**
*
* @param type $user
* @return type
*/
public function deleteUser($user)
{
return $user->delete();
}
示例12: clean_checked_tables
protected function clean_checked_tables()
{
self::$checked_tables = array();
$this->cache->delete('fs_checked_tables');
}
示例13: uninstall
/**
* Remove options values from the database.
*/
public function uninstall()
{
$this->options->delete();
}
示例14: deleteContact
/**
* Deletes a contact
* @param type $artist_id
* @return type
*/
public function deleteContact($contact_id)
{
$this->tableGateway->delete(array('contact_id' => $contact_id));
return;
}
示例15: deleteArtist
/**
*
* @param type $artist_id
* @return type
*/
public function deleteArtist($artist_id)
{
$this->tableGateway->delete(array('artist_id' => $artist_id));
return;
}