On delete log item

@param mixed $id
@param ActivityListener $listener
@return type
327701
public function delete($id = null, ActivityListener $listener)
    {
        if (is_null($id) && !is_null($range = Input::get('daterange'))) {
            return $this->deleteByRange($listener, $range);
        }
        if (is_null($id) && !is_null($ids = input('attr'))) {
            return $this->deleteByIds($listener, $ids);
        }

        $model = Logs::withoutGlobalScopes()->whereHas('user', function($query) {
                    $query->whereIn('id', $this->users());
                })->find($id);
        if (is_null($model)) {
            return $listener->deleteFailed();
        }
        $model->delete();
        return $listener->deleteSuccess();
    }
117848
public function removeListener(EventListener $listener)
    {
        if (($i = array_search($listener, $this->listeners)) !== false) {
            unset($this->listeners[$i]);
        }
        return $this;
    }
1230929
public function deleteAction($id)
    {
        $delete = function ($id) {
            $this->getManager()->delete($id);
        };
        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
848024
public function disable(DestroyListener $listener, $id)
    {
        try {
            DB::transaction(function() use($id) {
                $model            = ComponentParams::where('id', $id)->first();
                $data             = $model->data;
                $data['disabled'] = true;
                $model->data      = $data;
                $this->repository->saveEntity($model);
            });

            return $listener->whenDestroySuccess();
        } catch (Exception $e) {
            Log::emergency($e);
            return $listener->whenDestroyError(['message' => $e->getMessage(), 'code' => $e->getCode()]);
        }
    }
850985
public function edit(RuleListener $listener, $id)
    {
        $rule = $this->repository->findById($id);

        if (!$rule) {
            return $listener->notFound($id);
        }

        $form = $this->presenter->form($rule);

        $this->dispatcher->fire('antares.form: ban_management.rules', [$rule, $form]);
        $this->dispatcher->fire('antares.form: foundation.ban_management.rules', [$rule, $form, 'foundation.ban_management']);

        return $listener->showEditForm(compact('rule', 'form'));
    }
1248271
public function removeEventListener($event, $listener){
     if (!$this->events[$event]) return $this;
   

    $indexOf = 0;
    foreach ($this->Iterator('Array') as $EventListener) {
       if($EventListener === $listener)	{
         array_splice($this->events[$event], $indexOf, 1);	   	
         $indexOf--;
	   }
         $indexOf++;
    }
    return $this; 	
  }
972925
public function delete($table = '', $id = '')
    {
        $sql = 'DELETE FROM '.$table.' WHERE id='.$id;
        echo $sql.'<br/>';
        return $this->execute($sql);
    }
837197
protected function deleteByRange(ActivityListener $listener, $range)
    {
        $start = null;
        $end   = null;
        extract(json_decode($range, true));
        if (is_null($start) or is_null($end)) {
            return $listener->deleteFailed();
        }
        if (!$this->repository->deleteByRange($start, $end)) {
            return $listener->deleteFailed();
        }
        return $listener->deleteSuccess();
    }
1003046
public function removeListener( $event, EventListener $listener = null ) {

		$event = strtolower( $event );

		if ( !$this->hasEvent( $event ) ) {
			return;
		}

		if ( $listener !== null ) {
			foreach ( $this->dispatchableListeners[$event] as $key => $dispatchableListener ) {
				if ( $dispatchableListener == $listener ) {
					unset( $this->dispatchableListeners[$event][$key] );
				}
			}
		}

		if ( $listener === null || $this->dispatchableListeners[$event] === array() ) {
			unset( $this->dispatchableListeners[$event] );
		}
	}
1361394
public function deleteAction($id)
    {
        $delete = function($id) {
            try {
                $collectionManager = $this->getCollectionManager();
                $collectionManager->delete($id);
            } catch (CollectionNotFoundException $cnf) {
                throw new EntityNotFoundException(self::$entityName, $id); // will throw 404 Entity not found
            } catch (MediaException $me) {
                throw new RestException($me->getMessage(), $me->getCode()); // will throw 400 Bad Request
            }
        };

        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
1279935
public function edit(Listener $listener, $id)
    {
        $eloquent = with(new Eloquent())->findOrNew($id);
        $name     = $eloquent->name;
        $raw      = app('antares.memory')->make('ui-components')->raw();
        $data     = isset($raw[$name]['data']) ? $raw[$name]['data'] : [];
        if (!empty($data)) {
            foreach ($data as $attribute => $value) {
                $eloquent->{$attribute} = $value;
            }
        }
        $form = $this->presenter->form($name, $eloquent, "antares::ui-components/updater");
        return $listener->showComponentUpdater($id, compact('form'));
    }
896183
public function removeListener(Listener $listener) {
		foreach ($this->listeners as $id => $listening) {
			if ($listener == $listening) {
				unset($this->listeners[$id]);
				break;
			}
		}
	}
641488
public function removeEventListener(string $name, callable $listener): self
    {
        if (isset($this->internalEventListenersData[$name])) {
            foreach ($this->internalEventListenersData[$name] as $i => $value) {
                if ($value === $listener) {
                    unset($this->internalEventListenersData[$name][$i]);
                    if (empty($this->internalEventListenersData[$name])) {
                        unset($this->internalEventListenersData[$name]);
                    }
                    break;
                }
            }
        }
        return $this;
    }
663359
public function removeEventListener($eventName, $listener)
    {
        if (!$this->dispatcher) {
            $this->dispatcher = new EventDispatcher();
        }

        $this->dispatcher->removeListener($eventName, $listener);

        return $this;
    }
1233259
public function update(Listener $listener, $id)
    {
        $model = LogsLoginDevices::query()->findOrFail($id);
        $form  = new DeviceForm($model);
        if (!$form->isValid()) {
            return $listener->deviceUpdateFailedValidation();
        }
        $model->name = Input::get('name');
        if (!$model->save()) {
            return $listener->deviceUpdateFailed();
        }
        return $listener->deviceUpdateSuccess();
    }
307804
public function delete($id, GeneratorListener $listener)
    {
        $model = Report::where('id', $id)->first();
        if (is_null($model)) {
            return $listener->deleteFailed();
        }
        if ($model->delete()) {
            return $listener->deleteFailed();
        }
        return $listener->deleteSuccess();
    }
202806
public function delete($id = null) {
		$this->request->allowMethod('post');
		$log = $this->DatabaseLogs->get($id);

		if ($this->DatabaseLogs->delete($log)) {
			$this->Flash->success(__('Log deleted'));
			return $this->redirect(['action' => 'index']);
		}
		$this->Flash->error(__('Log was not deleted'));
		return $this->redirect(['action' => 'index']);
	}