mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
doc: add hook helpers to ent website (#729)
This commit is contained in:
@@ -133,7 +133,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -120,7 +120,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -133,7 +133,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -120,7 +120,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -120,7 +120,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -133,7 +133,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -120,7 +120,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -133,7 +133,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -120,7 +120,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -120,7 +120,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -146,7 +146,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
@@ -146,7 +146,7 @@ func HasFields(field string, fields ...string) Condition {
|
||||
|
||||
// If executes the given hook under condition.
|
||||
//
|
||||
// Hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
|
||||
//
|
||||
func If(hk ent.Hook, cond Condition) ent.Hook {
|
||||
return func(next ent.Mutator) ent.Mutator {
|
||||
|
||||
Reference in New Issue
Block a user