123456789101112131415 |
- <?php
- class Image extends DBObjectAutoCreate {
- public static function GetImagesByAlbum($albumId) {
- self::CreateTable("images");
- $images=array();
- $prep=self::$PDO->prepare("SELECT image_id FROM images WHERE album_id=? AND image_deleted=0");
- $prep->execute(array($albumId));
- while ($imageId=$prep->fetchColumn())
- $images[]=new Image($imageId);
- }
-
- public function __construct($id) {
- parent::__construct("images", "image_id", $id);
- }
- }
|