X-Git-Url: http://git.inspyration.org/?p=zf2.biz%2Fgalerie.git;a=blobdiff_plain;f=module%2FGalerie%2Fsrc%2FGalerie%2FModel%2FGalerieInfoTable.php;h=3696821066e2cf24ff5f05e9e3cc90f1170f2f24;hp=2acd45dc83b0dd9094a653019bf63b12fd9e509b;hb=8bd8f746674c0992e71e1a6952d0d37580291930;hpb=a8a6dbc32613045bedebff292f83aedc5380c49c diff --git a/module/Galerie/src/Galerie/Model/GalerieInfoTable.php b/module/Galerie/src/Galerie/Model/GalerieInfoTable.php index 2acd45d..3696821 100644 --- a/module/Galerie/src/Galerie/Model/GalerieInfoTable.php +++ b/module/Galerie/src/Galerie/Model/GalerieInfoTable.php @@ -87,4 +87,37 @@ class GalerieInfoTable implements TableGatewayInterface throw new \Exception('delete is not allowed'); } + public function all() + { + return $this->select(); + } + + public function one($id) + { + if ($id === null) { + $row = null; + } else { + $row = $this->select(array('gallery.id' => (int) $id))->current(); + } + if (!$row) { + throw new \Exception("cannot get row {id: {$id}} in table 'galerie'"); + } + return $row; + } + + public function any($id) + { + if ($id === null) { + $row = null; + } else { + $row = $this->select(array('gallery.id' => (int) $id))->current(); + } + return $row; + } + + public function all_by_user($id_user) + { + return $this->select(array('gallery.id_user' => (int) $id_user)); + } + }