Show:
Module: parch

Table of Contents

Methods

getOwner
(
  • child
)
Object

Get the owner of an object

Parameters:

  • child Object

    object from which to fetch the parent

Returns:

Object:

parent (owner)

Example:

class UserController extends parch.Controller {
  doStuff(req, res, next) {
    const store = getOwner(this).lookup("service:store");

    return store.findAll();
  }
}
setOwner
(
  • child
  • parent
)

Set the owner object of the child object

Parameters:

  • child Object

    child object

  • parent Object

    parent (owner) object

Example:

setOwner({}, "service:store", "store");

{}.store