<?php
class ImageRepository extends BaseRepository implements IImageRepository {
	public static function GetImagesByAlbum($albumId) {
		$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);
		return $images;
	}

	public static function DeleteImages($imageIds) {
		$inQuery = implode(',', array_fill(0, count($imageIds), '?'));
		$prep=self::$PDO->prepare("UPDATE images SET image_deleted=1 WHERE image_id IN ($inQuery)");
		$prep->execute($imageIds);
	}
}
