ACL()->get_granted_base()); $qb = $this->createQueryBuilder('f'); $qb->where($qb->expr()->isNull('f.baseId')) ->orWhere('f.public = true'); if (!empty($base_ids)) { $qb->orWhere($qb->expr()->in('f.baseId', $base_ids)); } $qb->orderBy('f.updatedOn', 'DESC'); return $qb->getQuery()->getResult(); } /** * Returns the given feed if the user can access to it. * * @param Application $app * @param \User_Adapter $user * @param type $id * @return Feed */ public function loadWithUser(Application $app, \User_Adapter $user, $id) { $feed = $this->find($id); if ($feed) { $coll = $feed->getCollection($app); if ($feed->isPublic() || $coll === null || in_array($coll->get_base_id(), array_keys($user->ACL()->get_granted_base()))) { return $feed; } } return null; } /** * Returns all the feeds from a given array containing their id. * * @param array $feed_id * @return Collection */ public function findByIds(array $feedIds) { $qb = $this->createQueryBuilder('f'); if (!empty($feedIds)) { $qb->Where($qb->expr()->in('f.id', $feedIds)); } $qb->orderBy('f.updated_on', 'DESC'); return $qb->getQuery()->getResult(); } }