App\Model\AlbumRepository::findById PHP Méthode

findById() public méthode

public findById ( $id ) : ActiveRow
Résultat Nette\Database\Table\ActiveRow
    public function findById($id)
    {
        return $this->findAll()->get($id);
    }

Usage Example

 public function deleteFormSucceeded()
 {
     $this->albums->findById($this->getParameter('id'))->delete();
     $this->flashMessage('Album has been deleted.');
     $this->redirect('default');
 }