Skip to content

Commit

Permalink
chapter 04: adding role and header interfaces to use in entityManager
Browse files Browse the repository at this point in the history
  • Loading branch information
devcorpio committed Mar 31, 2019
1 parent 0a29dff commit 3a3cf49
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* In order to improve the understanding of this code, this file it is supposing to implement the following interfaces:
*
* interface PersistsEntitiesInterface {
* function persist(entity);
*
* function flush();
* }
*
* interface HasUnitOfWorkInterface {
* function getUnitOfWork(name);
* }
*
* interface EntityManagerInterface extends PersistsEntitiesInterface, HasUnitOfWorkInterface {
*
* }
*
* Quack Quack Quack 🦆 typing :D
*/

/**
* @implements {EntityManagerInterface}
*/
function entityManager() {
function persist(entity) {
// make something here...
}

function flush() {
// make something here
}

function getUnitOfWork() {
// make something here
}

return {
persist,
flush,
getUnitOfWork,
};
}

module.exports = entityManager;

0 comments on commit 3a3cf49

Please sign in to comment.