本文整理汇总了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;
}
示例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);
}
示例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);
}
示例4: delete
/** delete */
public function delete($dao)
{
$item = $dao->getItem();
parent::delete($dao);
if ($dao->getGroupId() == MIDAS_GROUP_ANONYMOUS_KEY) {
$this->computePolicyStatus($item);
}
}
示例5: delete
/** delete */
public function delete($dao)
{
$folder = $dao->getFolder();
parent::delete($dao);
if ($dao->getGroupId() == MIDAS_GROUP_ANONYMOUS_KEY) {
$this->computePolicyStatus($folder);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}