other objects * * @author Marijn Huizendveld <
[email protected]> * @version $Revision: 163 $ changed by $Author: buroknapzak $ * * @copyright De Baas Media (2010) */ class kluPublicationPeer extends BasekluPublicationPeer { /** * Select the publications that have recently been updated. * * @param string $arg_connection * * @return array */ static public function retrieveRecentlyUpdatedForDomain ($arg_domainUnifiedResourceName = NULL, $arg_connection = NULL) { $sql = "SELECT * FROM (SELECT `publications`.`id` AS ID " . ", `publications`.`name` AS NAME " . ", `publications`.`unified_resource_name` AS UNIFIED_RESOURCE_NAME " . ", `publications`.`domain_unified_resource_name` AS DOMAIN_UNIFIED_RESOURCE_NAME " . ", `publications`.`introduction` AS INTRODUCTION " . ", `publications`.`created_at` AS CREATED_AT " . ", MAX(`revision_requests`.`applied_at`) AS UPDATED_AT " . ", `publications`.`deleted_at` AS DELETED_AT " . "FROM `revision_requests` " . "LEFT JOIN `updates` " . "ON (`updates`.`id` = `revision_requests`.`update_id`) " . "LEFT JOIN `update_collections` " . "ON `updates`.`collection_unified_resource_name` = `update_collections`.`unified_resource_name` " . "LEFT JOIN `publications` " . "ON (`publications`.`id` = `revision_requests`.`publication_id`) " . "WHERE `updates`.`revision_request_id` IS NULL " . "AND `publications`.`deleted_at` IS NULL " . "AND `publications`.`domain_unified_resource_name` = ? " . "AND `update_collections`.`publish_at` <= NOW() " . "AND `update_collections`.`publish_until` > NOW() " . "GROUP BY `revision_requests`.`publication_id` " . "ORDER BY `updated_at` DESC) " . "`publications` ORDER BY `updated_at` DESC"; $connection = NULL === $arg_connection ? Propel::getConnection(self::DATABASE_NAME) : $arg_connection; $statement = $connection->prepareStatement($sql); return self::populateObjects($statement->executeQuery(array(0 => $arg_domainUnifiedResourceName), ResultSet::FETCHMODE_NUM)); } }