function getArticleGalleys($galleyIds, $context) { $galleys = array(); $articleGalleyDao = DAORegistry::getDAO('ArticleGalleyDAO'); foreach ($galleyIds as $galleyId) { $articleGalley = $articleGalleyDao->getById($galleyId, null, $context->getId()); if ($articleGalley && $articleGalley->getStoredPubId('doi')) { $galleys[] = $articleGalley; } } return $galleys; }