App\Model\AlbumRepository::findById PHP Method

findById() public method

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

Usage Example

コード例 #1
0
 public function deleteFormSucceeded()
 {
     $this->albums->findById($this->getParameter('id'))->delete();
     $this->flashMessage('Album has been deleted.');
     $this->redirect('default');
 }