Gets multiple photos

@param array $ids List of photo ids
@param array $options
@see SimplePhoto::build()
@return mixed|PhotoCollection
197984
public function collection(array $ids, array $options = array())
    {
        $photos = $this->dataStore->getPhotos($ids);

        if (empty($photos) && !$this->storageManager->hasFallback()) {
            // If no fallback has been defined, and no photo was found
            // lets just skip the computation that follows.
            return $this->createPhotoCollection();
        }

        $found = array();
        array_map(function ($photo) use ($ids, &$found) {
            // This will be used to build found Photos
            return $found[$photo['id']] = $photo;
        }, $photos);

        $sorted = array();
        foreach ($ids as $index => $id) {
            $photo = array();
            if (array_key_exists($id, $found)) {
                $photo = $found[$id];
            }

            $sorted[$index] = $photo;
        }

        $photos = $this->createPhotoCollection($sorted);
        $simplePhoto = $this; // php 5.3 compatibility
        $photos->transform(function ($photo) use ($simplePhoto, $options) {
            return $simplePhoto->build($photo, $options);
        })->ksort();

        return $photos;
    }
125442
public function getNodeRepositories($ids)
    {
        $types = $this->getService('repos:base.node')
                ->getQuery()
                ->disableChain()
                ->id($ids);

        $types->distinct = true;
        $repositories = array();
        foreach ($types->fetchValues('type') as $key => $type) {
            $type = explode(',', $type);
            $identifier = end($type);
            $repositories[] = AnDomain::getRepository($identifier);
        }

        return $repositories;
    }
291235
public function select($collectionName, array $ids)
    {
        $mappedIds = array_map(function ($id) use ($collectionName) {
            return sprintf('%s:%s', $collectionName, $id);
        }, $ids);
        $params = ['foreign_ids' => join(',', $mappedIds)];
        $response = $this->doRequest('GET', 'meta/', $params);
        $body = $response->getBody()->getContents();
        return json_decode($body, true);
    }
612499
public function getList(array $options = array())
    {
        $uri = $this->buildListResourceUri($this->listId);
        $response = $this->makeApiRequest($uri, $options);
        return $response->list;
    }
277049
public function getMany(array $ids) {
		$data = [];
		
		foreach ($ids as $id) {
			$result = $this->get($id);
			
			if ($result !== false) {
				$data[$id] = $result;
			}
		}
		
		return $data;
	}
301538
public function getData(array $options)
    {
        $provider = $this->getProvider();

        $ownerDetails = $provider->getResourceOwner($this->accessToken);

        return new Result([
            'externalId' => $ownerDetails->getId(),
            'name'       => trim($ownerDetails->getFirstname() . ' ' . $ownerDetails->getLastname()),
            'profileUrl' => $ownerDetails->getUrl(),
            'photoUrl'   => $ownerDetails->getImageurl()
        ]);
    }
402053
public function findById(array $ids)
    {
        $ids = $this->idsToMongo($ids);

        $documents = array();
        $remaining = array();
        foreach ($ids as $id) {
            if ($this->identityMap->has($id)) {
                $documents[(string) $id] = $this->identityMap->get($id);
            } else {
                $remaining[] = $id;
            }
        }

        if (count($documents) == count($ids)) {
            return $documents;
        }

        return array_merge(
            $documents,
            $this->createQuery(array('_id' => array('$in' => $remaining)))->all()
        );
    }
311161
public function getByIds($classname, Array $ids)
    {
        $classname = $classname . '\Sync';
        $classnameArray = $classname . '\ArrayObject';
        $objects = new $classnameArray();
        $objects->append(new $classname(array('id' => $ids)));

        $response = $this->request(
            $this->buildUrl(new $classname(), null, '/sync_fetch_ids'), 'POST', $this->mapper->mapToStorage($objects)
        );
        return $this->mapper->mapFromStorage($response);
    }
300016
public function createCollection(array $data, array $options = [])
    {
        $this->setOptions($options);
        $coll = new Collection($this->client, $this->database);
        $coll->setHeaders($this->getHeaders());
        $rs = $coll->create($data);
        $this->checkResponse($rs);
        unset($rs['_curl_info']);

        return $rs;
    }
1228974
public function getMenuPages( $ids, $map = false ) {

		if( count( $ids ) > 0 ) {

			$modelClass	= static::$modelClass;

			if( $map ) {

				$pages = $modelClass::find()->filterWhere( [ 'in', 'id', $ids ] )->all();

				$pageMap = [];

				foreach( $pages as $page ) {

					$pageMap[ $page->id ] = $page;
				}

				return $pageMap;
			}
			else {

				return $modelClass::find()->andFilterWhere( [ 'in', 'id', $ids ] )->all();
			}
		}

		return [];
	}
974910
public static function deleteByIds($ids, array $params = [])
    {
        if (!is_array($ids)) {
            $ids = explode(",", $ids);
        }

        $m = new static;
        $pk = $m->getPrimaryKey();
        $records = [];
        foreach ($ids as $id) {
            $records[] = [$pk => $id];
        }

        return static::bulkDelete($records, $params);
    }
20891
public function getFiles($ids)
    {
        settype($ids, 'array');

        $libraries = $this->getList();
        $sorted = $this->graph->sort($ids, $libraries);

        if (empty($sorted)) {
            return array();
        }

        return $this->prepareFiles($sorted, $libraries);
    }
703638
public function listCollections(array $options = [])
    {
        $this->setOptions($options);
        $coll = new Collection($this->client, $this->database);
        $coll->setHeaders($this->getHeaders());
        $rs = $coll->getAll();
        $this->checkResponse($rs);
        $colls = array_get($rs, 'DocumentCollections');
        $list = [];
        if (!empty($colls)) {
            foreach ($colls as $coll) {
                $list[] = array_get($coll, 'id');
            }
        }

        return $list;
    }
1128309
public function findMany($ids, $columns = array('*'))
    {
        if (empty($ids)) {
            return $this->model->newCollection();
        }

        $keyName = $this->model->getQualifiedKeyName();

        $this->query->whereIn($keyName, $ids);

        return $this->get($columns);
    }
1026671
public function getMultilevelChildren($id, array $options = [])
	{
		$options['for']    = $id;
		$options['direct'] = false;

		$options['for']    = $id;
		$options['direct'] = false;

		$query    = $this->_table->find();
		$iterator = $this->findChildren($query, $options);

		$primaryKey = $this->_table->getSchema()->primaryKey();
		$primaryKey = count($primaryKey) == 1 ? $primaryKey[0] : $primaryKey;

		$parent_id_fieldname = $this->getConfig('model_parent_id_fieldname');

		$nodes_by_pk = [];
		$root_nodes  = [];

		foreach($iterator as $node)
		{
			$nodes_by_pk[$node->{$primaryKey}] = $node;

			if($node->{$parent_id_fieldname} == $id)
			{
				$root_nodes[] = $node;
			}

			if(isset($nodes_by_pk[$node->{$parent_id_fieldname}]))
			{
				if(!isset($nodes_by_pk[$node->{$parent_id_fieldname}]->children))
				{
					$nodes_by_pk[$node->{$parent_id_fieldname}]->children = [];
				}

				$nodes_by_pk[$node->{$parent_id_fieldname}]->children[] = $node;
			}
		}
		unset($node);

		return new \Cake\Collection\Collection($root_nodes);
	}
523149
public function getByIds(array $ids, array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::GET,
            ResourceMethodEnum::GET_BY_IDS,
            $params,
            $ids
        );
    }
802132
public function getPopular(array $options = [], array $headers = [])
    {
        return $this->getFactory()->createResultCollection(
            $this->getApi()->getPopular($options, $headers)
        );
    }