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


PHP AppModel::delete方法代码示例

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


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

示例1: delete

 /**
  * Overwrite delete to delete to the datasource defined in config
  *
  * {@inheritDoc}
  */
 public function delete($id = null, $cascade = true)
 {
     $this->setDataSourceWrite();
     $retval = parent::delete($id, $cascade);
     $this->setDataSourceRead();
     return $retval;
 }
开发者ID:simaostephanie,项目名称:CakePHP-DatabaseLog,代码行数:12,代码来源:DatabaseLogAppModel.php

示例2: delete

 /**
  * Delete a contact
  * @param null $id
  * @param bool $cascade
  * @return bool
  */
 public function delete($id = null, $cascade = true)
 {
     if (isset($id)) {
         $this->dataSource->api->delete("contato/cod/{$id}");
         return true;
     }
     return parent::delete($id, $cascade);
 }
开发者ID:lsantosc,项目名称:cakephp-mediapost,代码行数:14,代码来源:MediaPostContact.php

示例3: delete

 public function delete($id = null, $cascade = true)
 {
     $sended = $this->field('sended', array('Post.id' => $id));
     if ($sended) {
         return false;
     }
     return parent::delete($id, $cascade);
 }
开发者ID:slywalker,项目名称:madeleine,代码行数:8,代码来源:post.php

示例4: delete

 /** delete */
 public function delete($dao)
 {
     $item = $dao->getItem();
     parent::delete($dao);
     if ($dao->getGroupId() == MIDAS_GROUP_ANONYMOUS_KEY) {
         $this->computePolicyStatus($item);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:9,代码来源:ItempolicygroupModelBase.php

示例5: delete

 /** delete */
 public function delete($dao)
 {
     $folder = $dao->getFolder();
     parent::delete($dao);
     if ($dao->getGroupId() == MIDAS_GROUP_ANONYMOUS_KEY) {
         $this->computePolicyStatus($folder);
     }
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:9,代码来源:FolderpolicygroupModelBase.php

示例6: delete

 /**
  * Validation rules
  *
  * @var array
  */
 public function delete($id = null, $cascade = true)
 {
     if ($id == NULL) {
         $id = $this->id;
     }
     $x = $this->find('first', array('conditions' => array('Banner.id' => $id)));
     unlink('files/banner_image/' . $x['Banner']['image']);
     parent::delete($id, $cascade);
 }
开发者ID:ashutoshdev,项目名称:openrug.com,代码行数:14,代码来源:Banner.php

示例7: delete

 public function delete($id = null, $cascade = true)
 {
     if ($id == NULL) {
         $id = $this->id;
     }
     $x = $this->find('first', array('conditions' => array('Rug.id' => $id)));
     $this->removeDir("webroot/files/templates/" . $id);
     parent::delete($id, $cascade);
 }
开发者ID:ashutoshdev,项目名称:openrug.com,代码行数:9,代码来源:Rug.php

示例8: delete

 public function delete($id = null, $cascade = true)
 {
     if ($id == NULL) {
         $id = $this->id;
     }
     $x = $this->find('first', array('conditions' => array('Rugpng.id' => $id)));
     unlink($x['Rugpng']['path']);
     parent::delete($id, $cascade);
 }
开发者ID:ashutoshdev,项目名称:openrug.com,代码行数:9,代码来源:Rugpng.php

示例9: delete

 public function delete($id = null, $cascade = true)
 {
     if ($id == null) {
         $id = $this->id;
     }
     $path = $this->read(array('image'), $id);
     $vale = explode('ofood/', $path['Recipe']['image']);
     unlink($vale[1]);
     parent::delete($id, $cascade);
 }
开发者ID:ashutoshdev,项目名称:pickmeals-web,代码行数:10,代码来源:Recipe.php

示例10: delete

 public function delete($id = null, $cascade = true)
 {
     if ($id == null) {
         $id = $this->id;
     }
     $path = $this->read(array('file'), $id);
     $unlink = explode('files/', $path[$this->alias]['file']);
     unlink('files/' . $unlink[1]);
     parent::delete($id, $cascade);
 }
开发者ID:ashutoshdev,项目名称:pickmeals-web,代码行数:10,代码来源:Splash.php

示例11: delete

 /**
  * handles the contact delete of adres
  *
  * @param integer $id 
  * @return boolean
  * @author Rajib 
  */
 public function delete($id)
 {
     $field_types = ClassRegistry::init('FieldType')->find('all');
     $fields = Set::extract($field_types, "/FieldType/class_name");
     foreach ($fields as $className) {
         //$this->{$className}->recursive = -1;
         ClassRegistry::init($className)->deleteAll(array('contact_id' => $id), false);
     }
     //this cascading enable HABTM delete of Group
     return parent::delete($id, true);
 }
开发者ID:rajibahmed,项目名称:Adres,代码行数:18,代码来源:contact.php

示例12: delete

 function delete($id = NULL, $cascade = true)
 {
     $this->id = $id;
     $media = $this->read();
     if (!$media) {
         return False;
     }
     $dir = $media['Media']['file_dir'];
     unlink(Configure::read('project_dir') . '/webroot/' . $dir . '/' . $media['Media']['file_name']);
     return parent::delete();
 }
开发者ID:xstation1021,项目名称:kdkitchen,代码行数:11,代码来源:Media.php

示例13: delete

 function delete($id = null)
 {
     $upload = $this->findById($id);
     if (!$upload) {
         return false;
     }
     // Delete DB record first
     $deleted = parent::delete($id);
     // Delete the actual file
     $path = Configure::read('Wildflower.uploadDirectory') . DS . $upload[$this->name]['name'];
     $this->deleteFiles($path);
     return $deleted;
 }
开发者ID:alfo1,项目名称:wildflower,代码行数:13,代码来源:wild_upload.php

示例14: delete

 function delete($id = NULL, $cascade = true)
 {
     $attachment = $this->read();
     $dir = $attachment['Attachment']['file_dir'];
     //$folders = array('disp', 'thumbnails', 'thumbnails_mini');
     $folders = array('disp', 'thumbnails', 'cropped');
     foreach ($folders as $folder) {
         $filepath = Configure::read('project_dir') . '/webroot/' . $dir . '/' . $folder . '/' . $attachment['Attachment']['file_name'];
         if (file_exists($filepath)) {
             unlink($filepath);
         }
     }
     parent::delete();
 }
开发者ID:xstation1021,项目名称:kdkitchen,代码行数:14,代码来源:Attachment.php

示例15: delete

 function delete($id)
 {
     $upload = $this->findById($id);
     if (!$upload) {
         return $this->cakeError('object_not_found');
     }
     // Delete DB record first
     if (parent::delete($upload[$this->name]['id'])) {
         $path = Configure::read('Wildflower.uploadDirectory') . DS . $upload[$this->name]['name'];
         $this->_deleteFiles($path);
         return true;
     }
     return false;
 }
开发者ID:hanakorori,项目名称:wildflower,代码行数:14,代码来源:wild_asset.php


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