\Dewdrop\Fields\HelperHelperInterface

All Fields API helpers must implement this interface. There is a lot of information about the helper API in HelperAbstract.

Summary

Methods
Constants
matchesName()
assign()
getFieldAssignment()
detectCallableForField()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

matchesName()

matchesName(string  $name) : boolean

Check to see if the supplied input matches this helper's name (case-insensitive).

Parameters

string $name

Returns

boolean

assign()

assign(mixed  $assignments, callable  $callable = null) : \Dewdrop\Fields\Helper\HelperAbstract

Assign one more custom per-instance callbacks for this helper. If the $arguments param is an array, this method expects that the keys will be field IDs and the values will be callables, assigning custom callbacks for multiple fields in one call. If, however, $assignments is a string or a FieldInterface object, a single custom callback assignment will be made.

Parameters

mixed $assignments
callable $callable

Returns

\Dewdrop\Fields\Helper\HelperAbstract

getFieldAssignment()

getFieldAssignment(\Dewdrop\Fields\FieldInterface  $field) : callable

Get the callback that will be used for the given FieldInterface object.

Parameters

\Dewdrop\Fields\FieldInterface $field

Throws

\Dewdrop\Fields\Exception\HelperCallableNotAvailableForField

Returns

callable

detectCallableForField()

detectCallableForField(\Dewdrop\Fields\FieldInterface  $field) : mixed

Try to supply a default callback by looking at the supplied FieldInterface object. This method will only be called for a field if no global or per-instance custom callbacks are assigned.

If no callback candidate is found, just return false from this method, which will be detected by getFieldsAssigned(), causing execution to halt.

Parameters

\Dewdrop\Fields\FieldInterface $field

Returns

mixed —

Either false or a callable.