Entity Manager

To create an entity manager instance and use the methods bellow:

let manager = wetland.getManager();


Creates a new entity manager scope.



Returns an entity repository instance for provided entity.

Note: If you're planning on doing work with the unit of work (wetland.getManager() / EntityManager.createScope()) you must use the scope to get the repository.

Repositories fetched from the entity manager are a more performant way of querying the database, but they're never linked to a scope. If all you're planning on doing is fetching data or performing simple queries, this method is for you.

The queries performed on a repository fetched from the EntityManager do run in an internal scope, so they're safe to use in for example APIs.



Gets the config using .getConfig() from wetland.



Returns all registered entities as an object.



Get the reference to an entity constructor by its name.



Get the mapping for provided entity. Can be an instance, constructor or the name of the entity.



Register multiple entities.

manager.registerEntities([entity1, entity2]);


Register a single entity.



Resolve provided value to an entity reference. The argument can be a name, the constructor or the entity itself.


results matching ""

    No results matching ""