当前位置: 首页>>代码示例>>PHP>>正文


PHP MY_Model::delete方法代码示例

本文整理汇总了PHP中MY_Model::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::delete方法的具体用法?PHP MY_Model::delete怎么用?PHP MY_Model::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MY_Model的用法示例。


在下文中一共展示了MY_Model::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($field_id)
 {
     $this->db->where('field_id', $field_id);
     $field = $this->db->get('mcb_fields')->row();
     $this->drop_column($field->object_id, 'custom_' . $field->field_index);
     parent::delete(array('field_id' => $field_id));
 }
开发者ID:najahnasir,项目名称:MyClientBase,代码行数:7,代码来源:mdl_fields.php

示例2: delete

 public function delete($id)
 {
     // Delete a page
     parent::delete($id);
     // Reset parent ID for its children
     $this->db->set(['parent_id' => 0])->where('parent_id', $id)->update($this->_table_name);
 }
开发者ID:TraianAlex,项目名称:ci21,代码行数:7,代码来源:page_m.php

示例3: delete

 public function delete($id)
 {
     /* Delete a page */
     parent::delete($id);
     /* Reset parent ID for its children */
     $this->db->set(array('parent_id' => 0))->where('parent_id', $id)->update($this->_table_name);
 }
开发者ID:kew11,项目名称:equanimous-cms,代码行数:7,代码来源:page_m.php

示例4: delete

 public function delete($tenancy_id)
 {
     $this->load->model('miniant/tenancy_log_model');
     parent::delete($tenancy_id);
     $this->tenancy_log_model->delete_tenancy($tenancy_id);
     return null;
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:7,代码来源:Tenancy_model.php

示例5: delete

 public function delete($id)
 {
     $custom_field = $this->get_by_id($id);
     $exists = $this->db->query("SHOW COLUMNS FROM `" . $custom_field->custom_field_table . "` LIKE " . $this->db->escape($custom_field->custom_field_column));
     if ($exists->num_rows() == 1) {
         $this->db->query("ALTER TABLE `" . $custom_field->custom_field_table . "` DROP `" . $custom_field->custom_field_column . "`");
     }
     parent::delete($id);
 }
开发者ID:rumahkecil,项目名称:fusioninvoice-1,代码行数:9,代码来源:mdl_custom_fields.php

示例6: delete

 function delete($id = 0)
 {
     $this->load->helper('file');
     // Delete all files within the album
     delete_files($this->albums_dir . $id, TRUE);
     // Delete the album too
     @rmdir($this->albums_dir . $id);
     $this->db->delete('photos', array('album_id' => $id));
     return parent::delete($id);
 }
开发者ID:Tapha,项目名称:pyrocms,代码行数:10,代码来源:photo_albums_m.php

示例7: hapus_slide

 public function hapus_slide($id = 0)
 {
     $data = parent::get($id);
     if (file_exists($data->slide_image)) {
         unlink($data->slide_image);
     }
     if (file_exists($data->slide_thumb)) {
         unlink($data->slide_thumb);
     }
     parent::delete($id);
 }
开发者ID:fathan,项目名称:CI-Hotel,代码行数:11,代码来源:m_slide.php

示例8: delete

 /**
  * Deletes a blog category only if it doesn't have any articles in it
  * @param int $id Blog Category ID
  * @return bool
  */
 public function delete($id)
 {
     if (empty($id)) {
         return FALSE;
     }
     // get portfolios by category id
     $articles = $this->check_article_by_cat($id);
     if (!empty((array) $articles)) {
         return json_encode(array('error' => 1));
     }
     return parent::delete($id);
 }
开发者ID:alex-krav,项目名称:personal-page-codeigniter,代码行数:17,代码来源:blog_categories_model.php

示例9: delete

 public function delete($id_or_fields)
 {
     if (is_array($id_or_fields)) {
         $job_sites = $this->get($id_or_fields);
     } else {
         $job_sites = array($this->get($id_or_fields));
     }
     $result = parent::delete($id_or_fields);
     foreach ($job_sites as $job_site) {
         $bookings = $this->booking_model->get(array('job_site_id' => $job_site->id));
         foreach ($bookings as $booking) {
             $this->booking_model->delete($booking->id);
         }
     }
     $this->db->query("DELETE FROM `building_bookings` WHERE job_site_id NOT IN ( SELECT id FROM building_job_sites)");
     return $result;
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:17,代码来源:Job_site_model.php

示例10: delete

 public function delete($id_or_fields)
 {
     if (is_array($id_or_fields)) {
         $tradesmen = $this->get($id_or_fields);
     } else {
         $tradesmen = array($this->get($id_or_fields));
     }
     $result = parent::delete($id_or_fields);
     foreach ($tradesmen as $tradesman) {
         $bookings = $this->booking_model->get(array('tradesman_id' => $tradesman->id));
         foreach ($bookings as $booking) {
             $this->booking_model->delete($booking->id);
         }
     }
     $this->db->query("DELETE FROM `building_bookings` WHERE tradesman_id NOT IN ( SELECT id FROM building_tradesmen)");
     return $result;
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:17,代码来源:Tradesman_model.php

示例11: delete

 public function delete($id_or_fields)
 {
     if (is_array($id_or_fields)) {
         $bookings = $this->get($id_or_fields);
     } else {
         $bookings = array($this->get($id_or_fields));
     }
     $result = parent::delete($id_or_fields);
     foreach ($bookings as $booking) {
         $recipients = $this->booking_recipient_model->get(array('booking_id' => $booking->id));
         foreach ($recipients as $recipient) {
             $this->booking_recipient_model->delete($recipient->id);
         }
     }
     $this->db->query("DELETE FROM `building_booking_recipients` WHERE booking_id NOT IN ( SELECT id FROM building_bookings)");
     return $result;
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:17,代码来源:Booking_model.php

示例12: delete

 public function delete($client_id)
 {
     $this->load->model('invoices/mdl_invoices');
     /* Delete the client record */
     parent::delete(array('client_id' => $client_id));
     /* Delete any related contacts */
     $this->db->where('client_id', $client_id);
     $this->db->delete('mcb_contacts');
     /*
      * Delete any related invoices, but use the invoice model so records
      * related to the invoice are also deleted
      */
     $this->db->select('invoice_id');
     $this->db->where('client_id', $client_id);
     $invoices = $this->db->get('mcb_invoices')->result();
     foreach ($invoices as $invoice) {
         $this->mdl_invoices->delete($invoice->invoice_id);
     }
 }
开发者ID:Meritxell01,项目名称:prova,代码行数:19,代码来源:mdl_clients.php

示例13: delete

 function delete($id)
 {
     /*
     		TODO: This code does not work anymore. We should fix.
     	
     		// Delete files from the file host.
     		if($data = $this->get_by_id($id))
     		{
     			switch($data['CMS_MediaStore'])
     			{
     				case 'rackspace-cloud-files':
     					$this->load->spark('cloudmanic-storage/1.0.4');
     					$this->storage->load_driver('rackspace-cf');
     					$this->storage->delete_file($this->data['cms']['cp_media_rackspace_container'], $data['CMS_MediaPath'] . $data['CMS_MediaFile']);
     					
     					// Delete thumb
     					if($data['CMS_MediaIsImage'])
     					{
     						$this->storage->delete_file($this->data['cms']['cp_media_rackspace_container'], $data['CMS_MediaPathThumb'] . $data['CMS_MediaFileThumb']);
     					}
     				break;
     				
     				case 'amazon-web-services-s3':
     					$this->load->spark('cloudmanic-storage/1.0.4');
     					$this->storage->load_driver('amazon-s3');
     					$this->storage->delete_file($this->data['cms']['cp_media_amazon_s3_container'], $data['CMS_MediaPath'] . $data['CMS_MediaFile']);
     					
     					// Delete thumb
     					if($data['CMS_MediaIsImage'])
     					{
     						$this->storage->delete_file($this->data['cms']['cp_media_amazon_s3_container'], $data['CMS_MediaPathThumb'] . $data['CMS_MediaFileThumb']);
     					}
     				break;
     				
     				case 'local-files':
     					@unlink($this->data['cms']['cp_media_local_dir'] . $data['CMS_MediaFile']);
     					@unlink($this->data['cms']['cp_media_local_dir'] . $data['CMS_MediaFileThumb']);
     				break;
     			}
     		}
     */
     return parent::delete($id);
 }
开发者ID:cloudmanic,项目名称:cloudmanic-cms,代码行数:43,代码来源:cms_media_model.php

示例14: delete

 /**
  * In addition to deleting the user record, this also deletes associated contacts and role assignments
  * @param int $user_id
  * @return bool
  */
 public function delete($user_id)
 {
     $user = $this->get($user_id);
     $result = parent::delete($user_id);
     if ($result) {
         $contacts = $this->user_contact_model->get(array('user_id' => $user_id));
         $roles = $this->get_roles($user_id);
         if (!empty($contacts)) {
             foreach ($contacts as $contact) {
                 $this->user_contact_model->delete($contact->id);
             }
         }
         if (!empty($roles)) {
             foreach ($roles as $role) {
                 $this->unassign_role($user_id, $role->id);
             }
         }
     }
     return $result;
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:25,代码来源:User_model.php

示例15: delete

 /**
  * In addition to deleting this contact, if it is the default_choice, assign default_choice to another contact of the same type if it exists
  * @param $contact_id ID of the contact detail
  * @return boolean true unless something goes majorly wrong in SQL
  */
 public function delete($contact_id)
 {
     $contact = $this->user_contact_model->get($contact_id, true);
     $result = parent::delete($contact_id);
     if (!$result) {
         return false;
     }
     if ($contact->default_choice) {
         $otherdefaultcontacts = $this->user_contact_model->get(array('user_id' => $contact->user_id, 'default_choice' => 1, 'type' => $contact->type), true);
         // If at least one other contact is already default, do nothing else
         if ($otherdefaultcontacts) {
             return true;
         }
         $othernondefaultcontact = $this->user_contact_model->get(array('user_id' => $contact->user_id, 'default_choice' => 0, 'type' => $contact->type), true);
         if (!empty($othernondefaultcontact)) {
             $this->user_contact_model->edit($othernondefaultcontact->id, array('default_choice' => 1));
         }
     }
     return true;
 }
开发者ID:nicolasconnault,项目名称:streamliner,代码行数:25,代码来源:User_contact_model.php


注:本文中的MY_Model::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。