<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
class Album_Api_Core extends Core_Api_Abstract
{

	/**
	 * Get Flush Photo Count
	 *
	 * @return photocount
	 */
	public function getFlushPhotoData() {
		$GetTableNamePhoto = Engine_Api::_()->getItemTable('photo');
		$tableNamePhoto = $GetTableNamePhoto->info('name');
		$select = $GetTableNamePhoto->select()->from($tableNamePhoto, new Zend_Db_Expr('COUNT(photo_id) as total'))->where('album_id =?', 0)->where('DATE(NOW()) != DATE(creation_date)');
		$data = $GetTableNamePhoto->fetchRow($select);
		return (int) $data->total;
	}
	
	/**
	 * Get Flush Photo Data
	 *
	 * @return photos
	 */
	public function getFlushPhotosData() {
	
		$GetTableNamePhoto = Engine_Api::_()->getItemTable('photo');
		$tableNamePhoto = $GetTableNamePhoto->info('name');
		$select = $GetTableNamePhoto->select()->from($tableNamePhoto)->where('album_id =?', 0)->where('DATE(NOW()) != DATE(creation_date)');
		return $GetTableNamePhoto->fetchAll($select);
	}
}
