Remove the specified resource from storage.

@param  $parent
@param  $model

@return Redirect
194222
public function destroy($parent = null, $model = null)
    {
        if ($this->repository->delete($model)) {
            return back();
        }
    }
499786
public function deleteByParent( $parentId, $parentType ) {

		//$modelClass	= static::$modelClass;

		//return $modelClass::deleteByParent( $parentId, $parentType );

		$models	= $this->getByParent( $parentId, $parentType );

		foreach ( $models as $model ) {

			$this->delete( $model );
		}
	}
30952
public function beforeDelete(Model $model, $cascade = true) {
        if (empty($model->id)) {
            return false;
        }

        return $this->deleteFiles($model, $model->id, array(), true);
    }
711696
public function getPdf(PdfDocument $model, AbstractModel $parent = null)
    {
        return $this->request($this->buildUrl($model, $parent, null, 'pdf'), 'GET');
    }
247548
public function delete(Model $model)
    {
        $deleted = $model->delete();

        if ($deleted) {
            app('cache')->flush();
        }

        return $deleted;
    }
78547
public function setParent(\marvin255\serviform\interfaces\Field $parent)
    {
        $this->parent = $parent;

        return $this;
    }
447407
public function remove($model, $version) {
		$operations = Configure::read('FileStorage.imageSizes.' . $model . '.' . $version);

		if (empty($operations)) {
			$this->out(__d('file_storage', 'Invalid table or version.'));
			$this->_stop();
		}

		try {
			$this->_loop('remove', $model, [$version => $operations]);
		} catch (Exception $e) {
			$this->out($e->getMessage());
			$this->_stop();
		}
	}
192566
public function delete( $model, $config = [] ) {

		$admin = isset( $config[ 'admin' ] ) ? $config[ 'admin' ] : false;

		if( isset( $model ) ) {

			// Only admin is authorised to delete a shared file using file browser.
			if( $admin || !$model->shared ) {

				// Delete mappings
				Yii::$app->factory->get( 'modelFileService' )->deleteByModelId( $model->id );

				// Delete from disk
				$model->clearDisk();

				// Delete model
				return parent::delete( $model, $config );
			}
		}

		return false;
	}
670358
def delete(self, name):
        
        if name not in self._parent:
            raise KeyError('model "{}" not present'.format(name))
        del self._parent[name]
        if self._current_model_group == name:
            self._current_model_group = None
600138
public function setParent(ModelInterface $childModel, ModelInterface $parentModel)
    {
        $this->relationshipManager->setParent($childModel, $parentModel);

        return $this;
    }
750110
public static function findChildren($model, $parentId) {
        return $children = $model::find()->where(['parent_id' => $parentId])->orderBy('position')->all();
    }
333323
public function actionRemoveParent($itemName, $parentName)
    {
        /* @var $am CAuthManager|AuthBehavior */
        $am = Yii::app()->getAuthManager();

        if ($am->hasItemChild($parentName, $itemName)) {
            $am->removeItemChild($parentName, $itemName);
            if ($am instanceof CPhpAuthManager) {
                $am->save();
            }
        }

        $this->redirect(array('view', 'name' => $itemName));
    }
980829
public function remove(Builder $builder, Model $model)
    {
        $query      = $builder->getQuery();
        $column     = $model->getQualifiedPositionColumn();

        foreach ((array) $query->orders as $key => $order) {

            if ($order['column'] == $column) {
                $this->removeOrderBy($query, $key);
            }
        }
    }
1116622
public function destroy(Model $model)
    {
        $this->mention->where('model_type', get_class($this->model))
            ->where('model_id', $this->model->getKey())
            ->where('recipient_type', get_class($model))
            ->where('recipient_id', $model->getKey())
            ->delete();
    }
666932
private function doCommitDelete(Model $model)
    {
        $this->dispatchLifecycleEvent(Events::preDelete, $model);

        $this->getPersisterFor($model->getType())->delete($model);
        $model->getState()->setDeleted();

        $this->dispatchLifecycleEvent(Events::postDelete, $model);
        return $model;
    }
859411
public function delete( $model, $config = [] ) {

		$existingFormSubmit	= self::findById( $model->id );

		// Delete Dependency
		$this->formSubmitFieldService->deleteByFormSubmitId( $model->id );

		return parent::delete( $model, $config );
	}
189495
public function retractFrom($model, array $keys = null)
    {
        list($model, $keys) = Helpers::extractModelAndKeys($model, $keys);

        $query = $this->newBaseQueryBuilder()
            ->from(Models::table('assigned_roles'))
            ->where('role_id', $this->getKey())
            ->where('entity_type', $model->getMorphClass())
            ->whereIn('entity_id', $keys);

        Models::scope()->applyToRelationQuery($query, $query->from);

        $query->delete();

        return $this;
    }