Show:
Module: parch

Base controller

Constructor

Controller
(
  • registry
  • options
)

Defined in src/controller.js:9

Parameters:

  • registry Object

    module registry

  • options Object

    configuration options

    • model String

      override the default model name

Methods

getModelName
(
  • model
)
String

Returns the name of the model that is associated with this controller. If options.model is passed to controller it will take precedence, otherwise the controller will attempt to lookup a model matching the controller's name

Parameters:

  • model String

    name of the model to use

Returns:

String:

modelName

Properties

errors

Object

Restify errors map restify-errors

internalModel

Object

The model class that belongs to this controller. If none could be found this will be undefined.

modelName

String

The name of the model that belongs to this controller. If one cannot be found this will be undefined

modelNameLookup

String

Pluralized version of modelName

models

Array

Object containing all models registered

STATUS_CODES

Object

An object mapping of status codes and their corresponding value

store

Object

Instance of Store