Filter a list of post IDs to only include posts that are visible to a
certain user.

@param array $ids
@param User $actor
@return array
321443
public function filterVisibleIds(array $ids, User $actor)
    {
        return $this->queryIds($ids, $actor)->pluck('posts.id')->all();
    }
376748
protected function idToUri($ids, $type)
    {
        $type = 'spotify:' . $type . ':';

        $ids = array_map(function ($id) use ($type) {
            if (substr($id, 0, strlen($type)) != $type) {
                $id = $type . $id;
            }

            return $id;
        }, (array) $ids);

        return (count($ids) == 1) ? $ids[0] : $ids;
    }
932995
protected function _getIds(array $ids, $primaryKey = self::PRIMARY_KEY)
    {
        $return = [];
        foreach ($ids as $id => $value) {
            if (is_array($value) && is_int($id) && (int) $value[$primaryKey] === 1) {
                $return[$id] = $id;
            }
        }

        return $return;
    }
1066966
public function applicablePages($ids)
    {
        // Basic permission check based on SiteTree::canEdit
        if (!Permission::check(array("ADMIN", "SITETREE_EDIT_ALL"))) {
            return array();
        }

        // Get pages that exist in stage and remove them from the restore-able set
        $stageIDs = Versioned::get_by_stage($this->managedClass, Versioned::DRAFT)->column('ID');
        return array_values(array_diff($ids, $stageIDs));
    }
1199922
public function remove($ids = [])
    {
        if (!is_array($ids)) {
            $ids = [$ids];
        }

        $result = $this->request(
            'POST',
            $this->getCore() . '/update/json',
            [],
            [
                'delete' => $ids
            ]
        );

        if ($this->isAutoCommit()) {
            $this->commit();
        }

        return $result;
    }
282825
public function findOrFail($id, User $actor = null)
    {
        $query = Group::where('id', $id);

        return $this->scopeVisibleTo($query, $actor)->firstOrFail();
    }
913052
protected function getApiDocument(User $actor, array $params)
    {
        $response = $this->api->send('Flarum\Api\Controller\ShowDiscussionController', $actor, $params);
        $statusCode = $response->getStatusCode();

        if ($statusCode === 404) {
            throw new RouteNotFoundException;
        }

        return json_decode($response->getBody());
    }
370797
public function where_id_in($ids)
        {
            return (Arrays::is($this->_getIdColumnName())) ?
                $this->where_any_is($this->_getCompoundIdColumnValuesArray($ids)) :
                $this->where_in($this->_getIdColumnName(), $ids);
        }
339670
public function several(array $ids)
    {
        $result = [];
        foreach ($ids as $id) {
            if ($this->has($id)) {
                $result[$id] = $this->get($id);
            }
        }
        return $result;

    }
192783
public function findByIds(array $ids): array
    {
        $spec = $this->createSpecification()->where(['id' => $ids]);

        return $this->findAll($spec);
    }
220427
private function findAccountsByIds($ids)
    {
        if (0 === count($ids)) {
            return [];
        }

        $queryBuilder = $this->entityManager->createQueryBuilder()
            ->select('CONCAT(\'a\', a.id) AS id, a.name AS name')
            ->from($this->accountEntityClass, 'a')
            ->where('a.id IN (:ids)');

        $query = $queryBuilder->getQuery();
        $query->setParameter('ids', $ids);

        return $query->getArrayResult();
    }
425570
public function findByIds(array $ids): array
    {
        $result = [];
        if (count($ids) > 0) {
            $queryBuilder = $this->entityManager->createQueryBuilder();
            $queryBuilder->select('i')
                         ->from(Item::class, 'i')
                         ->andWhere('i.id IN (:ids)')
                         ->setParameter('ids', array_values($ids));

            $result = $queryBuilder->getQuery()->getResult();
        }
        return $result;
    }
968208
public function actorlistJsonAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $actor = $em->getRepository('CoreBundle:Actor')->find($id);

        if (!$actor) {
            throw $this->createNotFoundException('Unable to find Actor entity.');
        }
        
        /** @var \AdminBundle\Services\DataTables\JsonList $jsonList */
        $jsonList = $this->get('json_list');
        $jsonList->setRepository($em->getRepository('EcommerceBundle:Contract'));
        $jsonList->setActor($actor);
        $response = $jsonList->get();

        return new JsonResponse($response);
    }
15039
public function hide(User $actor = null)
    {
        if (! $this->hidden_at) {
            $this->hidden_at = Carbon::now();
            $this->hidden_user_id = $actor ? $actor->id : null;

            $this->raise(new Hidden($this));
        }

        return $this;
    }
428956
public function findManyByIds(array $ids)
    {
        $models = $this->model->whereIn($this->model->getKeyName(), array_unique($ids))
            ->get();

        return $models;
    }
16406
protected function gatherIdsFromTree(array $array, array $ids = array())
    {
        foreach ($array as $item) {
            $ids[] = $item['id'];
            if (isset($item['__children']) && count($item['__children'])) {
                $ids = $this->gatherIdsFromTree($item['__children'], $ids);
            }
        }

        return $ids;
    }
827540
public function rejectNotBlocker(array $ids): array
    {
        return BlockRelationship::where('blocked_by_id', $this->id)
                                ->whereIn('blocker_id', $ids)
                                ->pluck('blocker_id')
                                ->toArray();
    }