當前位置: 首頁>>代碼示例>>PHP>>正文


PHP type::delete方法代碼示例

本文整理匯總了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!"];
     }
 }
開發者ID:mariosas,項目名稱:plusf,代碼行數:12,代碼來源:ProdutoServices.php

示例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;
 }
開發者ID:fs-contributor,項目名稱:rtMedia,代碼行數:38,代碼來源:RTMediaAlbum.php

示例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);
 }
開發者ID:bradley-holt,項目名稱:zf2,代碼行數:13,代碼來源:RowGateway.php

示例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;
 }
開發者ID:SwiftSchool,項目名稱:School,代碼行數:14,代碼來源:memcached.php

示例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!");
 }
開發者ID:mariosas,項目名稱:plusf,代碼行數:13,代碼來源:ProdutosController.php

示例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!");
 }
開發者ID:mariosas,項目名稱:plusf,代碼行數:13,代碼來源:ClientesController.php

示例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!");
 }
開發者ID:mariosas,項目名稱:plusf,代碼行數:13,代碼來源:FornecedoresController.php

示例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;
 }
開發者ID:echoOly,項目名稱:php_base,代碼行數:55,代碼來源:BaseModel.php

示例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 . '.');
         }
     }
 }
開發者ID:vicenteserra,項目名稱:facturascripts_2015,代碼行數:14,代碼來源:admin_home.php

示例10: destroy

 /**
  * 
  * @param type $id
  */
 public function destroy($id)
 {
     $this->service->delete($id);
 }
開發者ID:mariosas,項目名稱:plusf,代碼行數:8,代碼來源:VendasController.php

示例11: deleteUser

 /**
  *
  * @param type $user
  * @return type
  */
 public function deleteUser($user)
 {
     return $user->delete();
 }
開發者ID:kyxer,項目名稱:barriosLaravel,代碼行數:9,代碼來源:UserRepository.php

示例12: clean_checked_tables

 protected function clean_checked_tables()
 {
     self::$checked_tables = array();
     $this->cache->delete('fs_checked_tables');
 }
開發者ID:BGCX067,項目名稱:facturascripts-svn-to-git,代碼行數:5,代碼來源:fs_model.php

示例13: uninstall

 /**
  * Remove options values from the database.
  */
 public function uninstall()
 {
     $this->options->delete();
 }
開發者ID:Air-Craft,項目名稱:air-craft-www,代碼行數:7,代碼來源:OptionsPage.php

示例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;
 }
開發者ID:hejames,項目名稱:jTrContact,代碼行數:10,代碼來源:ContactTable.php

示例15: deleteArtist

 /**
  *
  * @param type $artist_id
  * @return type
  */
 public function deleteArtist($artist_id)
 {
     $this->tableGateway->delete(array('artist_id' => $artist_id));
     return;
 }
開發者ID:hejames,項目名稱:jTrMuzik,代碼行數:10,代碼來源:ArtistTable.php


注:本文中的type::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。