Crud\Traits\FindMethodTrait::_notFound PHP Method

_notFound() protected method

Throw exception if a record is not found
protected _notFound ( string $id, Crud\Event\Subject $subject ) : void
$id string Record id
$subject Crud\Event\Subject Event subject
return void
    protected function _notFound($id, Subject $subject)
    {
        $subject->set(['success' => false]);
        $this->_trigger('recordNotFound', $subject);
        $message = $this->message('recordNotFound', compact('id'));
        $exceptionClass = $message['class'];
        throw new $exceptionClass($message['text'], $message['code']);
    }