Method to find many entity records.

@param {Repository<Entity>} repository
@param {FindManyOptions} options
@returns {(source, args, context, info) => Promise<Entity[]>}
168156
function findMany(repository, options) {
    const entityColumns = repository.metadata.columns.map((columnMetadata) => columnMetadata.propertyName);
    const entityManyToOneRelationColumns = repository
        .metadata
        .relations
        .filter((relationMetadata) => relationMetadata.relationType === 'many-to-one' || relationMetadata.relationType === 'one-to-one')
        .map((relationMetadata) => relationMetadata.propertyName);
    return function (source, args, context, info) {
        return __awaiter(this, void 0, void 0, function* () {
            const selectedColumns = Object.keys(graphqlFields(info));
            const selectQueryBuilder = repository.createQueryBuilder(repository.metadata.name.toLowerCase());
            /** Select **/
            const selectFactory = new select_factory_1.SelectFactory(selectQueryBuilder);
            selectFactory
                .select(selectedColumns.filter((select) => entityColumns.includes(select)));
            /** Where **/
            const whereFactory = new where_factory_1.WhereFactory(selectQueryBuilder, entityManyToOneRelationColumns);
            whereFactory
                .where(lodash_1.get(args, 'filter', {}));
            /** Joins **/
            const joinsFactory = new joins_factory_1.JoinsFactory(selectQueryBuilder);
            joinsFactory
                .join(selectedColumns
                .filter((select) => entityManyToOneRelationColumns.includes(select))
                .reduce((selectedRelationColumns, selectedRelationColumn) => {
                selectedRelationColumns[selectQueryBuilder.alias] = selectedRelationColumn;
                return selectedRelationColumns;
            }, {}))
                .join(whereFactory.selectedManyToOneOrOneToOneRelationColumns);
            /** Pagination **/
            const paginateFactory = new paginate_factory_1.PaginateFactory(selectQueryBuilder);
            paginateFactory
                .paginate(lodash_1.get(args, 'pagination', {}));
            /** Order by **/
            const orderFactory = new order_factory_1.OrderFactory(selectQueryBuilder);
            orderFactory
                .order(lodash_1.get(args, 'orderBy', []));
            /** Extend **/
            if (lodash_1.get(options, 'extend')) {
                yield options.extend(selectQueryBuilder);
            }
            /** Execute get many method **/
            return yield selectQueryBuilder.getMany();
        });
    };
}
569849
public static function find( $where = 'all', $options = array() )
	{

		$dbr = wfGetDB( DB_SLAVE );

		if ( !is_array( $where ) && $where == 'all' ) {

			/* Fetch all entities */
			$collection = $dbr->select( static::$table,
				'id',
				array(),
				__METHOD__,
				$options
			);

		} else {

			/* Fetch conditional entities */
			$collection = $dbr->select( static::$table,
				'id',
				$where,
				__METHOD__,
				$options
			);

		}

		/* Check result */
		if ( !$collection ) return array();

		/* Generate array of entities for return */
		$entities = array();
		foreach ( $collection as $row ) {

			/* Create entity */
			$modelClass = get_called_class();
			$entity = new $modelClass($row->id);

			$entities[] = $entity;

		}

		if ( !count( $entities ) ) return array();

		return $entities;

	}
905442
function doQuery(options) {
            return models.Webhook.getByEventAndTarget(options.data.webhooks[0].event, options.data.webhooks[0].target_url, _.omit(options, ['data']))
                .then((webhook) => {
                    if (webhook) {
                        return Promise.reject(new common.errors.ValidationError({message: common.i18n.t('errors.api.webhooks.webhookAlreadyExists')}));
                    }

                    return models.Webhook.add(options.data.webhooks[0], _.omit(options, ['data']));
                })
                .then((model) => {
                    return {
                        webhooks: [model.toJSON(options)]
                    };
                });
        }
847031
function modelQuery(options) {
            return models.Role.findAll(options)
                .then((models) => {
                    let roles = models.map((role) => {
                        return role.toJSON();
                    });

                    if (options.permissions !== 'assign') {
                        return {roles: roles};
                    }

                    return Promise.filter(roles.map((role) => {
                        return canThis(options.context).assign.role(role)
                            .return(role)
                            .catch(() => {});
                    }), (value) => {
                        return value && value.name !== 'Owner';
                    }).then((roles) => {
                        return {
                            roles: roles
                        };
                    });
                });
        }
141818
function findEntity(collection, entity) {
	return collection.findIndex(item => angular.equals(item, entity));
}
341593
function(entityId) {
      return api
        .one(config.entity, entityId)
        .get()
        .then(this.create, console.error);
    }
146909
function removeRecord(options) {
    let query = getQueryParams(options, ['name', 'content', 'type', 'query']);
    return find(options.domain, query).then(function (response) {
      let records = response.data.result;
      if (records.length === 0) {
        throw new Error('No matching records found');
      }
      let results = [];
      _.each(records, function (record) {
        results.push(self.cloudflareClient.removeRecord(record.zone_id, record.id));
      });
      return Promise.all(results);
    }).then(function (responses) {
      let messages = _.map(responses, function (response) {
        return 'Deleted record with id ' + response.data.result.id;
      });

      return new Result(messages);
    });
  }
933652
def get_any_entity(self, id=None, uri=None, match=None):
        

        if not id and not uri and not match:
            return None

        if type(id) == type("string"):
            uri = id
            id = None
            if not is_http(uri):
                match = uri
                uri = None
        if match:
            if type(match) != type("string"):
                return []
            res = []
            if ":" in match:  # qname
                for x in self.all_classes:
                    if match.lower() in x.qname.lower():
                        res += [x]
                for x in self.all_properties:
                    if match.lower() in x.qname.lower():
                        res += [x]
            else:
                for x in self.all_classes:
                    if match.lower() in x.uri.lower():
                        res += [x]
                for x in self.all_properties:
                    if match.lower() in x.uri.lower():
                        res += [x]
            return res
        else:
            for x in self.all_classes:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            for x in self.all_properties:
                if id and x.id == id:
                    return x
                if uri and x.uri.lower() == uri.lower():
                    return x
            return None
1046663
function collectionFind(filter, options) {
        if (!filter) {
            // TODO - limit of ten by
            return collections[ this['_collection'] ]
        }

        if ( typeof(filter) !== 'object' ) { // == findAll
            throw new Error('filter must be an object');
        } else {
            //console.log('search into ', this['_collection'], collections[ this['_collection'] ], collections);
            var content             = collections[ this['_collection'] ]
                , condition         = filter.count()
                , i                 = 0
                , found             = []
                , localeLowerCase   = '';

            for (var o in content) {
                for (var f in filter) {
                    localeLowerCase = ( typeof(filter[f]) != 'boolean' ) ? filter[f].toLocaleLowerCase() : filter[f];
                    if ( filter[f] && keywords.indexOf(localeLowerCase) > -1 && localeLowerCase == 'not null' && typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] != 'null' && content[o][f] != 'undefined' ) {
                        if (found.indexOf(content[o][f]) < 0 ) {
                            found[i] = content[o][f];
                            ++i
                        }

                    } else if ( typeof(content[o][f]) != 'undefined' && typeof(content[o][f]) !== 'object' && content[o][f] === filter[f] ) {
                        found[i] = content[o];
                        ++i
                    }
                }
            }
        }

        return found
    }
899732
function makeFindQuery(getter) {
  return (container, text, options, waitForElementOptions) =>
    waitForElement(
      () => getter(container, text, options),
      waitForElementOptions,
    )
}
1189739
function next() {
		var repo;
		if ( count === len ) {
			debug( 'Finished all queries.' );
			out.meta.success = scount;
			out.meta.failure = fcount;
			return clbk( null, out );
		}
		if ( idx < len ) {
			repo = repos[ idx ];
			debug( 'Querying repository `%s` (%d).', repo, idx );

			options.path = '/'+repo+'/'+opts.branch+'/'+filepath;
			debug( 'Path: %s', options.path );

			request( options, onResponse( repo, idx ) );
			idx += 1;
		}
	}
796953
@SuppressWarnings("unchecked")
	public <T> List<T> findAll(Class<T> entity) {
		if (entity == null) {
			throw new ApitraryOrmException("Cannot access null entity");
		}

		log.debug("Loading all " + entity.getName());

		QueriedGetRequest request = new QueriedGetRequest();
		request.setEntity(resolveApitraryEntity(entity));
		QueriedGetResponse response = resolveApitraryClient().send(request);

		if (HttpStatus.OK.ordinal() == response.getStatusCode()) {
			return (List<T>) new QueriedGetResponseUnmarshaller(this).unMarshall(response, entity);
		} else {
			/*
			 * happens more often than expected...
			 */
			// if(HttpStatus.Internal_Server_Error.ordinal() ==
			// response.getStatusCode()){
			// throw new
			// CommunicationErrorException(HttpStatus.Internal_Server_Error);
			// }
			throw new CommunicationErrorException(HttpStatus.getStatus(response.getStatusCode()), response.getResult());
		}
	}
169284
function entitiesToDatastore(entities, options) {
    const multiple = is.array(entities);
    entities = arrify(entities);

    if (entities[0].className !== 'Entity') {
        // Not an entity instance, nothing to do here...
        return entities;
    }

    const result = entities.map(e => toDatastore(e, options));

    return multiple ? result : result[0];
}
574245
function modelQuery(options) {
            return models.Post.edit(options.data.posts[0], omit(options, ['data']))
                .then((model) => {
                    if (!model) {
                        return Promise.reject(new common.errors.NotFoundError({
                            message: common.i18n.t('errors.api.posts.postNotFound')
                        }));
                    }

                    const post = urlsForPost(model.id, model.toJSON(options), options);

                    // If previously was not published and now is (or vice versa), signal the change
                    // @TODO: `statusChanged` get's added for the API headers only. Reconsider this.
                    post.statusChanged = false;
                    if (model.previous('status') !== model.get('status')) {
                        post.statusChanged = true;
                    }

                    return {
                        posts: [post]
                    };
                });
        }
253363
public ResourceIterator<Node> findEntities(GraphDatabaseService executionEngine, EntityKey[] keys) {
		if ( singlePropertyKey ) {
			return singlePropertyIdFindEntities( executionEngine, keys );
		}
		else {
			return multiPropertiesIdFindEntities( executionEngine, keys );
		}
	}
385929
function doQuery(options) {
            // only User Agent (type = `ua`) clients are available at the moment.
            options.data = extend(options.data, {type: 'ua'});

            return models.Client.findOne(options.data, omit(options, ['data']))
                .then((model) => {
                    if (!model) {
                        return Promise.reject(new common.errors.NotFoundError({
                            message: common.i18n.t('common.api.clients.clientNotFound')
                        }));
                    }

                    return {
                        clients: [model.toJSON(options)]
                    };
                });
        }
1345163
function createFixtures(entity) {
        return new Promise(function(resolve, reject) {
            if (!entity.fixtures) return resolve();
            return Promise.all(entity.fixtures.map(function(fixture) {
                CRUD.fromCache(entity.getType(), fixture).Persist(true);
            })).then(resolve, reject);
        });
    }