Devolve um registro com base em seu ID
Se $failable for true, falhas vão disparar ModelNotFoundException.

@param int  $id
@param bool $failable

@return Model
345755
public function findByID($id, bool $failable = false)
    {
        $query = $this->newQuery();
        if($this->soft_deletes == true) {
            $query->withTrashed();
        }

        return ($failable == true)
            ? $query->findOrFail($id) : $query->find($id);
    }
706540
protected function getNewUploadModel($id = null)
    {
        $uploadModel = $this->modelName();

        $upload = new $uploadModel;

        if ( ! $upload instanceof Uploadable)
        {
            throw new RuntimeException('The upload model must implement the "Kenarkose\Transit\Contract\Uploadable" interface.');
        }

        if ($id)
        {
            $upload->setKey($id);
        }

        return $upload;
    }
295397
public function delete($id)
    {
        $model = $this->find($id);

        if (!$model) {
            throw new RepositoryException("O item não solicitado não existe.");
        }

        return $model->delete();
    }
1078202
public function unlock($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        return $this->rest->put("$this->action/$id/unlock");
    }
392962
protected function handleFailure($id) {
		if ($this->failBehaviour & self::NOTFOUND_NOTICE) {
			trigger_error('Translation absent for the ID "' . $id . '" in the catalogs');
		}
		
		if ($this->failBehaviour & self::NOTFOUND_RETURN_ID) {
			return $id;
		}
		
		if ($this->failBehaviour & self::NOTFOUND_EXCEPTION) {
			throw new NoTranslation('Translation absent for the ID "' . $id . '" in the catalogs');
		}
	}
1274003
public function deleteBreakType($id)
    {
        list($response, $statusCode, $httpHeader) = $this->deleteBreakTypeWithHttpInfo ($id);
        return $response; 
    }
762751
public function reverseTransform($id)
    {
        if (!$id) {
            return null;
        }

        $object = $this->om
            ->getRepository($this->class)
            ->find($id)
        ;

        if (! $object) {
            throw new TransformationFailedException();
        }

        return $object;
    }
1294984
public function findOrFail($id)
    {
        if ($model = $this->find($id)) {
            return $model;
        }
        throw (new ModelNotFoundException)->setModel(get_class($this->getModel()));
    }
162543
protected function loadModel($id = null)
	{
		/** @var BaseActiveRecord $modelClass */
		$modelClass = $this->modelClass();
		if($id) {
			$this->modelInstance = $modelClass::findOne($id);
		} else {
			$this->modelInstance = new $modelClass();
		}
		$this->modelInstance->load($this->attributes, '');
		return $this->modelInstance;
	}
619463
public static function wrap( \Throwable $throwable ): Helper\ThrowableInterface {

    switch( true ) {
      //
      case $throwable instanceof Helper\ThrowableInterface:
        return $throwable;

      //
      case $throwable instanceof \LogicException:
      case $throwable instanceof \Error:
        return new Exception\Logic( $throwable->getMessage(), Exception\Logic::ID, [], $throwable );

      //
      case $throwable instanceof \RuntimeException:
        return new Exception\Runtime( $throwable->getMessage(), Exception\Runtime::ID, [], $throwable );
    }

    return new static( $throwable->getMessage(), static::ID, [], $throwable );
  }
1252947
public function get($id, $invalid_behavior = sfContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
    {
        $service = null;
        try {
            $service = parent::get($id, $invalid_behavior);
        } catch (RuntimeException $e) {
            if (false === $this->hasDefinition($id)) {
                throw $e;
            }

            if (false === $this->getDefinition($id)->isSynthetic()) {
                throw $e;
            }
        }

        if (
            true === ($service instanceof DispatchTagEventInterface)
            && true === $service->needDispatchEvent()
            && true === $this->hasDefinition($id)
            && true === $this->has('event.dispatcher')
        ) {
            foreach ($this->getDefinition($id)->getTags() as $tag => $datas) {
                if (false === isset($datas[0]['dispatch_event']) || true === $datas[0]['dispatch_event']) {
                    $this->services['event.dispatcher']->dispatch(
                        'service.tagged.'.$tag,
                        new Event($service, array('id' => $id))
                    );
                }
            }
        }

        return $service;
    }
874202
public function delete($id) {
        if (!$this->Model->admin['deletable']) {
            throw new ForbiddenException(__d('admin', 'Delete Access Protected'));
        }

        if ($this->overrideAction('delete', $id)) {
            return;
        }

        $this->Model->id = $id;

        $result = $this->AdminToolbar->getRecordById($this->Model, $id);

        if (!$result) {
            throw new NotFoundException(__d('admin', '%s Not Found', $this->Model->singularName));
        }

        if ($this->request->is('post')) {
            if ($this->Model->delete($id, true)) {
                $this->AdminToolbar->logAction(ActionLog::DELETE, $this->Model, $id);

                $this->AdminToolbar->setFlashMessage(__d('admin', 'Successfully deleted %s with ID %s', array(mb_strtolower($this->Model->singularName), $id)));
                $this->AdminToolbar->redirectAfter($this->Model);

            } else {
                $this->AdminToolbar->setFlashMessage(__d('admin', 'Failed to delete %s with ID %s', array(mb_strtolower($this->Model->singularName), $id)), 'is-error');
            }
        }

        $this->set('result', $result);
        $this->overrideView('delete');
    }
539172
public function unlock(string $id) : LockableInterface
    {
        if (isset($this->locks[$id]) === true) {
            unset($this->locks[$id]);
        }
        return $this;
    }
600817
public static function wrapException(\Throwable $exception): \Throwable
    {
        if ($exception instanceof ExceptionInterface) {
            return $exception;
        }

        if ($exception instanceof ConnectionException) {
            if ($exception instanceof ConnectionPDOException) {
                return new DatabaseException($exception->getMessage(), $exception->getCode(), $exception);
            }
            if ($exception instanceof ConnectionInvalidArgumentException) {
                return new InvalidArgumentException($exception->getMessage(), $exception->getCode(), $exception);
            }
            if ($exception instanceof ConnectionFileException) {
                return new FileException($exception->getMessage(), $exception->getCode(), $exception);
            }
        }

        if ($exception instanceof QueryScribeException) {
            if ($exception instanceof QueryScribeInvalidArgumentException) {
                return new InvalidArgumentException($exception->getMessage(), $exception->getCode(), $exception);
            }
            if ($exception instanceof QueryScribeInvalidReturnValueException) {
                return new InvalidReturnValueException($exception->getMessage(), $exception->getCode(), $exception);
            }
            if ($exception instanceof QueryScribeInvalidQueryException) {
                return new IncorrectQueryException($exception->getMessage(), $exception->getCode(), $exception);
            }
        }

        return $exception;
    }
1049003
public function archive(int $id): PodiumResponse
    {
        $threadArchiver = $this->getArchiver($id);

        if ($threadArchiver === null) {
            throw new ModelNotFoundException('Thread of given ID can not be found.');
        }

        return $threadArchiver->archive();
    }
1097721
public function activate($id)
    {
        $id = (int) $id;
        if ($id <= 0) {
            throw new Exception('Invalid param id');
        }
        $data = [];
        $data['id'] = $id;
        $data['status'] = 'active';
        return $this->update($data);
    }
103821
public static function getByIdentifier($id)
    {
        $file = config('filer.hash_routes') ? static::whereHash($id)->first() : static::find($id);

        if (!$file) {
            throw (new ModelNotFoundException)->setModel(static::class);
        }

        return $file;
    }