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


PHP Base_model::delete方法代码示例

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


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

示例1: delete

 /**
  * Deletes one Author
  * and the corresponding lang data
  *
  * @param int 	$id
  *
  * @return int	Number of delete items in main table
  *
  */
 public function delete($id)
 {
     $nb_rows = parent::delete($id, $this->_author_table);
     if ($nb_rows > 0) {
         parent::delete($id, $this->_author_lang_table);
     }
     return $nb_rows;
 }
开发者ID:pompalini,项目名称:emngo,代码行数:17,代码来源:demo_author_model.php

示例2: delete_temp

 public function delete_temp($Id = NULL)
 {
     $className = get_class($this);
     if (isset($Id) && $Id != NULL) {
         if (property_exists($className, $this->getStateKey())) {
             return $this->db->update($this->getTableName(), array($this->getStateKey() => 0), array('Id' => $Id));
         } else {
             return $this->db->delete($this->getTableName(), array('Id' => $Id));
         }
     } else {
         return parent::delete();
     }
 }
开发者ID:laiello,项目名称:flexiblearning,代码行数:13,代码来源:abstract_model.php

示例3: delete

 /**
  * Deletes one item definition
  * Also deletes :
  * - All items linked to this definition
  * - All corresponding extend field & extend fields instances
  * - Links between content & items
  *
  * @param null $id_item_definition
  *
  * @return int|void
  */
 public function delete($id_item_definition)
 {
     // Items instances IDs
     $item_ids = $this->get_keys_array('id_item', array($this->get_pk_name() => $id_item_definition), self::$_ITEM);
     // Items Definition & Item definition langs
     $where = array($this->get_pk_name() => $id_item_definition);
     parent::delete($where);
     parent::delete($where, $this->get_lang_table());
     // Extend fields instances
     if (!empty($item_ids)) {
         parent::delete(array('parent' => 'item', 'where_in' => array('id_parent' => $item_ids)), self::$_EXTEND_FIELDS);
     }
     // Extend Field definition
     parent::delete(array('parent' => 'item', 'id_parent' => $id_item_definition), self::$_EXTEND_FIELD);
     // Item definition
     parent::delete($where, self::$_ITEM);
     // Items links to content
     if (!empty($item_ids)) {
         parent::delete(array('where_in' => array('id_parent' => $item_ids)), self::$_ITEMS);
     }
 }
开发者ID:pompalini,项目名称:emngo,代码行数:32,代码来源:item_definition_model.php

示例4: remove

 /**
  * Remove one media
  * Unlink it from all content
  * Does not remove the source file
  *
  * @param $id_media
  */
 public function remove($id_media)
 {
     $where = array('id_media' => $id_media);
     parent::delete($where, 'media');
     parent::delete($where, 'media_lang');
     parent::delete($where, 'page_media');
     parent::delete($where, 'article_media');
 }
开发者ID:trk,项目名称:ionize,代码行数:15,代码来源:medialist_model.php

示例5: unlink_from_context

 public function unlink_from_context($id_extend_field, $context, $id_context = NULL)
 {
     $where = array('id_extend_field' => $id_extend_field, 'context' => $context);
     if (!is_null($id_context)) {
         $where['id_context'] = $id_context;
     }
     if ($this->exists($where, self::$_CONTEXT_TABLE)) {
         parent::delete($where, self::$_CONTEXT_TABLE);
     }
 }
开发者ID:pompalini,项目名称:ionize,代码行数:10,代码来源:extend_field_model.php

示例6: delete_extend_field

 public function delete_extend_field($id_extend_field)
 {
     // Begin transaction
     $this->{$this->db_group}->trans_start();
     // Definition
     parent::delete(array('id_extend_field' => $id_extend_field), 'extend_field');
     // Lang
     parent::delete(array('id_extend_field' => $id_extend_field), 'extend_field_lang');
     // Instances
     $this->delete_extend_fields($id_extend_field);
     // Context
     parent::delete(array('id_extend_field' => $id_extend_field), 'extend_field_context');
     // Transaction complete
     $this->{$this->db_group}->trans_complete();
     return $this->{$this->db_group}->trans_status();
 }
开发者ID:pompalini,项目名称:emngo,代码行数:16,代码来源:extend_field_model.php

示例7: delete_all

 /**
  * @param $id_tag
  *
  * @return bool|int|the
  */
 public function delete_all($id_tag)
 {
     $affected_rows = parent::delete(array('id_tag' => $id_tag));
     $this->{$this->db_group}->where('id_tag', $id_tag);
     $this->{$this->db_group}->delete('article_tag');
     return $affected_rows;
 }
开发者ID:pompalini,项目名称:emngo,代码行数:12,代码来源:tag_model.php

示例8: delete

 public function delete($id_item)
 {
     $affected_rows = 0;
     $item = $this->get($id_item);
     // Check if exists
     if ($this->exists(array($this->get_pk_name() => $id_item))) {
         // Item
         $affected_rows = parent::delete(array($this->get_pk_name() => $id_item));
         // Extend fields content delete
         $affected_rows += parent::delete(array('id_parent' => $id_item, 'parent' => 'item'), self::$_EXTEND_FIELDS);
         // Links with content
         $affected_rows += parent::delete(array('id_item' => $id_item), self::$_ITEMS);
         $this->_reorder($item['id_item_definition']);
     }
     return $affected_rows;
 }
开发者ID:trk,项目名称:ionize,代码行数:16,代码来源:item_model.php

示例9: delete_extend_field

 public function delete_extend_field($id_extend_field)
 {
     try {
         if (Event::has_listeners('Extend.field.delete.before')) {
             // Listeners must throw one Exception if the item cannot be deleted
             Event::fire('Extend.field.delete.before', $id_extend_field);
         }
         // Begin transaction
         $this->{$this->db_group}->trans_start();
         // Definition
         parent::delete(array('id_extend_field' => $id_extend_field), 'extend_field');
         // Lang
         parent::delete(array('id_extend_field' => $id_extend_field), 'extend_field_lang');
         // Instances
         $this->delete_extend_fields($id_extend_field);
         // Context
         // parent::delete(array('id_extend_field'=>$id_extend_field), 'extend_field_context');
         // Transaction complete
         $this->{$this->db_group}->trans_complete();
         return $this->{$this->db_group}->trans_status();
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }
开发者ID:rockylo,项目名称:ionize,代码行数:24,代码来源:extend_field_model.php

示例10: unlink_extend_from_element

 public function unlink_extend_from_element($id_extend, $id_ui_element)
 {
     $where = array('id_extend' => $id_extend, 'id_ui_element' => $id_ui_element);
     parent::delete($where, self::$_TBL_LK_EXTEND);
 }
开发者ID:trk,项目名称:ionize,代码行数:5,代码来源:ui_model.php


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