Converts the input entity object or the input array of entity objects to a query object.
The following conditions apply for this function:
In the case of array input, all objects in the array must be of the same type.
The result query will not contain any relation data.

entityToQuery(entity [, name]) → returns query

entityToQuery Argument Reference

entity variableName

Entity object or array of objects that needs to be converted to a query object.

name string

Name of the entity. Use this optional parameter to return the query of the given entity in the case of inheritance mapping.

Sample code invoking the entityToQuery function

Fork me on GitHub