Пример #1
0
    protected function getPhotos()
    {
        // load the photos uploaded in the last day
        $date = new SwatDate();
        $date->subtractDays(1);
        $date->toUTC();
        $instance_id = $this->app->getInstance() === null ? null : $this->app->getInstanceId();
        $sql = sprintf('select PinholePhoto.* from PinholePhoto
			inner join ImageSet on PinholePhoto.image_set = ImageSet.id
			where ImageSet.instance %s %s and PinholePhoto.dav_upload = %s
				and PinholePhoto.upload_date > %s
			order by original_filename asc', SwatDB::equalityOperator($instance_id), $this->app->db->quote($instance_id, 'integer'), $this->app->db->quote(true, 'boolean'), $this->app->db->quote($date->getDate(), 'date'));
        $photos = SwatDB::query($this->app->db, $sql, SwatDBClassMap::get('PinholeSimplePhotoWrapper'));
        return $photos;
    }