Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit f889d6f0
authored
Sep 20, 2014
by
overlookmotel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comments on hook function signatures
1 parent
80f9a4d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
lib/hooks.js
lib/hooks.js
View file @
f889d6f
...
...
@@ -147,7 +147,7 @@ Hooks.addHook = function(hookType, name, fn) {
/**
* A hook that is run before validation
* @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err)
* @param {Function} fn A callback function that is called with instance,
options,
callback(err)
*/
Hooks
.
beforeValidate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'beforeValidate'
,
name
,
fn
);
...
...
@@ -156,7 +156,7 @@ Hooks.beforeValidate = function(name, fn) {
/**
* A hook that is run after validation
* @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err)
* @param {Function} fn A callback function that is called with instance,
options,
callback(err)
*/
Hooks
.
afterValidate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'afterValidate'
,
name
,
fn
);
...
...
@@ -165,7 +165,7 @@ Hooks.afterValidate = function(name, fn) {
/**
* A hook that is run before creating a single instance
* @param {String} name
* @param {Function} fn A callback function that is called with attributes, callback(err)
* @param {Function} fn A callback function that is called with attributes,
options,
callback(err)
*/
Hooks
.
beforeCreate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'beforeCreate'
,
name
,
fn
);
...
...
@@ -174,7 +174,7 @@ Hooks.beforeCreate = function(name, fn) {
/**
* A hook that is run after creating a single instance
* @param {String} name
* @param {Function} fn A callback function that is called with attributes, callback(err)
* @param {Function} fn A callback function that is called with attributes,
options,
callback(err)
*/
Hooks
.
afterCreate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'afterCreate'
,
name
,
fn
);
...
...
@@ -183,7 +183,7 @@ Hooks.afterCreate = function(name, fn) {
/**
* A hook that is run before destroying a single instance
* @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err)
* @param {Function} fn A callback function that is called with instance,
options,
callback(err)
*
* @alias beforeDelete
*/
...
...
@@ -198,7 +198,7 @@ Hooks.beforeDelete = function(name, fn) {
/**
* A hook that is run after destroying a single instance
* @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err)
* @param {Function} fn A callback function that is called with instance,
options,
callback(err)
*
* @alias afterDelete
*/
...
...
@@ -213,7 +213,7 @@ Hooks.afterDelete = function(name, fn) {
/**
* A hook that is run before updating a single instance
* @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err)
* @param {Function} fn A callback function that is called with instance,
options,
callback(err)
*/
Hooks
.
beforeUpdate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'beforeUpdate'
,
name
,
fn
);
...
...
@@ -222,7 +222,7 @@ Hooks.beforeUpdate = function(name, fn) {
/**
* A hook that is run after updating a single instance
* @param {String} name
* @param {Function} fn A callback function that is called with instance, callback(err)
* @param {Function} fn A callback function that is called with instance,
options,
callback(err)
*/
Hooks
.
afterUpdate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'afterUpdate'
,
name
,
fn
);
...
...
@@ -231,7 +231,7 @@ Hooks.afterUpdate = function(name, fn) {
/**
* A hook that is run before creating instances in bulk
* @param {String} name
* @param {Function} fn A callback function that is called with instances,
field
s, callback(err)
* @param {Function} fn A callback function that is called with instances,
option
s, callback(err)
*/
Hooks
.
beforeBulkCreate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'beforeBulkCreate'
,
name
,
fn
);
...
...
@@ -240,16 +240,16 @@ Hooks.beforeBulkCreate = function(name, fn) {
/**
* A hook that is run after creating instances in bulk
* @param {String} name
* @param {Function} fn A callback function that is called with instances,
field
s, callback(err)
* @param {Function} fn A callback function that is called with instances,
option
s, callback(err)
*/
Hooks
.
afterBulkCreate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'afterBulkCreate'
,
name
,
fn
);
};
/**
* A hook that is run before destroing instances in bulk
* A hook that is run before destro
y
ing instances in bulk
* @param {String} name
* @param {Function} fn A callback function that is called with
where
, callback(err)
* @param {Function} fn A callback function that is called with
options
, callback(err)
*
* @alias beforeBulkDelete
*/
...
...
@@ -264,7 +264,7 @@ Hooks.beforeBulkDelete = function(name, fn) {
/**
* A hook that is run after destroying instances in bulk
* @param {String} name
* @param {Function} fn A callback function that is called with
where
, callback(err)
* @param {Function} fn A callback function that is called with
options
, callback(err)
*
* @alias afterBulkDelete
*/
...
...
@@ -279,7 +279,7 @@ Hooks.afterBulkDelete = function(name, fn) {
/**
* A hook that is run after updating instances in bulk
* @param {String} name
* @param {Function} fn A callback function that is called with
attribute, where
, callback(err)
* @param {Function} fn A callback function that is called with
options
, callback(err)
*/
Hooks
.
beforeBulkUpdate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'beforeBulkUpdate'
,
name
,
fn
);
...
...
@@ -288,7 +288,7 @@ Hooks.beforeBulkUpdate = function(name, fn) {
/**
* A hook that is run after updating instances in bulk
* @param {String} name
* @param {Function} fn A callback function that is called with
attribute, where
, callback(err)
* @param {Function} fn A callback function that is called with
options
, callback(err)
*/
Hooks
.
afterBulkUpdate
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'afterBulkUpdate'
,
name
,
fn
);
...
...
@@ -297,7 +297,7 @@ Hooks.afterBulkUpdate = function(name, fn) {
/**
* A hook that is run before a find (select) query
* @param {String} name
* @param {Function} fn A callback function that is called with
attribute, where
, callback(err)
* @param {Function} fn A callback function that is called with
options
, callback(err)
*/
Hooks
.
beforeFind
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'beforeFind'
,
name
,
fn
);
...
...
@@ -306,7 +306,7 @@ Hooks.beforeFind = function(name, fn) {
/**
* A hook that is run before a find (select) query, after any { include: {all: ...} } options are expanded
* @param {String} name
* @param {Function} fn A callback function that is called with
attribute, where
, callback(err)
* @param {Function} fn A callback function that is called with
options
, callback(err)
*/
Hooks
.
beforeFindAfterExpandIncludeAll
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'beforeFindAfterExpandIncludeAll'
,
name
,
fn
);
...
...
@@ -315,7 +315,7 @@ Hooks.beforeFindAfterExpandIncludeAll = function(name, fn) {
/**
* A hook that is run after a find (select) query
* @param {String} name
* @param {Function} fn A callback function that is called with
attribute, where
, callback(err)
* @param {Function} fn A callback function that is called with
instance(s), options
, callback(err)
*/
Hooks
.
afterFind
=
function
(
name
,
fn
)
{
return
Hooks
.
addHook
.
call
(
this
,
'afterFind'
,
name
,
fn
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment