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


PHP AppModel::beforeDelete方法代码示例

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


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

示例1: beforeDelete

 public function beforeDelete($cascade = true)
 {
     if (!empty($this->id)) {
         $this->PointLog->deleteAll(array('Point_id' => $this->id));
     }
     return parent::beforeDelete($cascade);
 }
开发者ID:kiang,项目名称:water,代码行数:7,代码来源:Point.php

示例2: beforeDelete

 /**
  * beforeDelete
  *
  * @param	bool	$cascade
  * @return	bool
  */
 public function beforeDelete($cascade = true)
 {
     if (!parent::beforeDelete($cascade)) {
         return false;
     }
     return true;
 }
开发者ID:kingsolmn,项目名称:CakePHP-Braintree-Plugin,代码行数:13,代码来源:braintree_app_model.php

示例3: beforeDelete

 public function beforeDelete($cascade = true)
 {
     /*
      * to delete related orderlines
      */
     $this->query("DELETE FROM {$this->OrderLine->table} WHERE order_id = '{$this->id}'");
     return parent::beforeDelete($cascade);
 }
开发者ID:rungrr,项目名称:drugs,代码行数:8,代码来源:Order.php

示例4: beforeDelete

 public function beforeDelete($cascade = true)
 {
     $image = $this->find('first', array('conditions' => array('Banner.id' => $this->id), 'fields' => array('Banner.img_url')));
     if (count($image) > 0) {
         $this->imageToDelete = $image['Banner']['img_url'];
     }
     parent::beforeDelete($cascade);
 }
开发者ID:bokac1984,项目名称:genije,代码行数:8,代码来源:Banner.php

示例5: beforeDelete

 public function beforeDelete($cascade = true)
 {
     /*
      * to delete related orders/orderlines
      */
     $this->query("DELETE o.*, l.* FROM {$this->Order->table} AS o " . "LEFT JOIN {$this->Order->OrderLine->table} AS l ON l.order_id = o.id " . "WHERE o.account_id = '{$this->id}'");
     $tmpPath = TMP . 'zip/' . $this->id;
     exec("/bin/rm -Rf {$tmpPath}");
     return parent::beforeDelete($cascade);
 }
开发者ID:rungrr,项目名称:drugs,代码行数:10,代码来源:Account.php

示例6: beforeDelete

 function beforeDelete($casca)
 {
     parent::beforeDelete($casca);
     // chequea si contiene planes asociados, no permite
     $count = $this->Plan->find('count', array('conditions' => array('Plan.titulo_id' => $this->id)));
     if ($count == 0) {
         return true;
     } else {
         $this->validationErrors[] = 'Existen Planes que tienen este tìtulo';
         return false;
     }
 }
开发者ID:Navdeep736,项目名称:regetp01,代码行数:12,代码来源:titulo.php

示例7: beforeDelete

 /**
  * (non-PHPdoc)
  * @see Model::beforeDelete()
  */
 function beforeDelete($cascade = true)
 {
     App::import('Model', 'BusinessDetail');
     $my_model = new BusinessDetail();
     $continue = parent::beforeDelete($cascade);
     $this->recursive = 1;
     $business = $this->find('first', array('conditions' => array('Business.id' => $this->id)));
     foreach ($business['BusinessDetail'] as $businessDetails) {
         $my_model->delete($businessDetails['id'], true);
     }
     return true;
 }
开发者ID:JesusRugama,项目名称:Promobot,代码行数:16,代码来源:Business.php

示例8: beforeDelete

 public function beforeDelete($cascade = false)
 {
     parent::beforeDelete($cascade);
     $categoria = $this->find('first', array('conditions' => array('NoticiaCategoria.id' => $this->id)));
     //        pr($categoria);exit;
     if (!empty($categoria['CategoriaFilha'][0]['id'])) {
         //            $this->Session->setFlash(__('This category can not be deleted because there are other categories related to it.'));
         return false;
     }
     if (!empty($categoria['Noticia'][0]['id'])) {
         //            $this->Session->setFlash(__('This category cannot be deleted because there are news related to it.'));
         return false;
     }
     return true;
 }
开发者ID:robertomendesgarcia,项目名称:prototipo,代码行数:15,代码来源:NoticiaCategoria.php

示例9: beforeDelete

 /**
  * Called before every deletion operation.
  *
  * @param boolean $cascade If true records that depend on this record will also be deleted
  *
  * @return boolean True if the operation should continue, false if it should abort
  */
 public function beforeDelete($cascade = true)
 {
     parent::beforeDelete($cascade);
     $action = $this->request->params['action'];
     if ($action == 'admin_delete') {
         $cat = $this->find('first', array('conditions' => array('Category.id' => $this->request->params['pass'][0])));
         if (count($cat['Post']) > 0) {
             foreach ($cat['Post'] as $key => $value) {
                 $this->query("DELETE FROM `categories_posts` WHERE `categories_posts`.`post_id` = " . $value['id']);
                 $this->query("INSERT INTO `categories_posts` (`category_id`, `post_id`) VALUES ('1', '" . $value['id'] . "');");
             }
         }
         $post_count = $this->find('count', array('joins' => array(array('table' => 'categories_posts', 'alias' => 'CategoriesPost', 'type' => 'INNER', 'conditions' => array('CategoriesPost.category_id' => 1))), 'group' => 'post_id'));
         $this->query("UPDATE `categories` SET `post_count` = '" . $post_count . "' WHERE `categories`.`id` = 1;");
     }
 }
开发者ID:hurad,项目名称:hurad,代码行数:23,代码来源:Category.php

示例10: beforeDelete

 public function beforeDelete($cascade = false)
 {
     parent::beforeDelete($cascade);
     /*
      $this->NoticiaComentario->deleteAll(array(
      'conditions' => array(
      'NoticiaComentario.noticia_id' => $this->id
      )
      ), false);
     
      $this->NoticiaImagem->deleteAll(array(
      'conditions' => array(
      'NoticiaComentario.noticia_id' => $this->id
      )
      ), false);
     */
     return true;
 }
开发者ID:robertomendesgarcia,项目名称:prototipo,代码行数:18,代码来源:Noticia.php

示例11: beforeDelete

 /**
  * 関連するユーザーを管理者グループに変更し保存する
  * 
  * @param boolean $cascade
  * @return boolean
  */
 public function beforeDelete($cascade = true)
 {
     parent::beforeDelete($cascade);
     $ret = true;
     if (!empty($this->data['UserGroup']['id'])) {
         $id = $this->data['UserGroup']['id'];
         $this->User->unBindModel(array('belongsTo' => array('UserGroup')));
         $datas = $this->User->find('all', array('conditions' => array('User.user_group_id' => $id)));
         if ($datas) {
             foreach ($datas as $data) {
                 $data['User']['user_group_id'] = Configure::read('BcApp.adminGroupId');
                 $this->User->set($data);
                 if (!$this->User->save()) {
                     $ret = false;
                 }
             }
         }
     }
     return $ret;
 }
开发者ID:baserproject,项目名称:basercms,代码行数:26,代码来源:UserGroup.php

示例12: beforeDelete

 public function beforeDelete($cascade = true)
 {
     parent::beforeDelete($cascade);
     return $this->checkDependantData($this->id, 'AcionamentoCampo_Produto');
 }
开发者ID:AmmonMa,项目名称:cake_ERP,代码行数:5,代码来源:AcionamentoCampo_Contrato.php

示例13: beforeDelete

 function beforeDelete()
 {
     parent::beforeDelete();
     return $this->id != 1;
 }
开发者ID:shashin62,项目名称:abc_audit,代码行数:5,代码来源:user.php

示例14: beforeDelete

 /**
  * Before Delete
  * 
  * 論理削除の場合、
  * @param bool $cascade
  * @return bool
  */
 public function beforeDelete($cascade = true)
 {
     if (!parent::beforeDelete($cascade)) {
         return false;
     }
     $data = $this->find('first', array('conditions' => array($this->alias . '.id' => $this->id)));
     $this->__deleteTarget = $data;
     if (!$this->softDelete(null)) {
         return true;
     }
     if ($data) {
         $this->deleteRelateSubSiteContent($data);
         $this->deleteAlias($data);
     }
     return true;
 }
开发者ID:baserproject,项目名称:basercms,代码行数:23,代码来源:Content.php

示例15: beforeDelete

 /**
  * 関連するページデータをカテゴリ無所属に変更し保存する
  * 
  * @param boolean $cascade
  * @return boolean
  * @access public
  */
 public function beforeDelete($cascade = true)
 {
     parent::beforeDelete($cascade);
     $id = $this->data['PageCategory']['id'];
     if ($this->releaseRelatedPagesRecursive($id)) {
         $path = $this->createPageCategoryFolder($this->find('first', array('conditions' => array('id' => $id))));
         $folder = new Folder();
         $folder->delete($path);
         return true;
     } else {
         return false;
     }
 }
开发者ID:kenz,项目名称:basercms,代码行数:20,代码来源:PageCategory.php


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