Mappers
n2n\bind\mapper\impl— pipelinen2n\bind\mapper\impl\pipe— retry-until-valid pipelinen2n\bind\mapper\impl\string— string & format validationn2n\bind\mapper\impl\numeric— numbersn2n\bind\mapper\impl\type— type enforcementn2n\bind\mapper\impl\enum— enumerationsn2n\bind\mapper\impl\date— dates & timesn2n\bind\mapper\impl\l10n— localen2n\bind\mapper\impl\closure— closures over values & propsn2n\bind\mapper\impl\compose— composing sub-plansn2n\bind\mapper\impl\mod— modifying the bind structuren2n\bind\mapper\impl\op— control flown2n\bind\mapper\impl\valobj— value objects
Mappers is the factory class for n2n-bind's mappers and validators (n2n\bind\mapper\impl\Mappers). Every method
returns a Mapper (or a composer) that you pass to Bind::…->map() / ->prop() / ->props(). The pages below
document each factory, grouped by the mapper's PHP namespace.
n2n\bind\mapper\impl — pipeline
- pipe —
pipe— chain multiple mappers/validators into one, running them in sequence.
n2n\bind\mapper\impl\pipe — retry-until-valid pipeline
- change-until-valid —
changeUntilValid— re-run a pipe with aRetryValueChangeruntil the value satisfies a uniqueness/validity check.
n2n\bind\mapper\impl\string — string & format validation
- email —
email - phone —
phone - url —
url - clean-string —
cleanString,cleanMultilineString - color-hex —
colorHex - path-part —
pathPart - no-special-chars —
noSpecialChars
n2n\bind\mapper\impl\numeric — numbers
n2n\bind\mapper\impl\type — type enforcement
- type —
type,typeNotNull
n2n\bind\mapper\impl\enum — enumerations
- enum —
enum
n2n\bind\mapper\impl\date — dates & times
- datetime —
dateTime,dateTimeImmutable - date —
date - time —
time - datetime-sql —
dateTimeSql - date-sql —
dateSql - time-sql —
timeSql
n2n\bind\mapper\impl\l10n — locale
- n2n-locale —
n2nLocale
n2n\bind\mapper\impl\closure — closures over values & props
- value —
value,valueIfNotNull(and the deprecatedvalueClosure,valueNotNullClosure) - bindable —
bindable,bindableIfNotNull(and the deprecatedbindableClosure,bindableNotNullClosure) - bindables —
bindables/closure(and the deprecatedbindablesClosure) - values —
values,valuesAny,valuesEvery,propsAsBindDataClosure(and the deprecatedpropsClosure) - value-as-bind-data —
valueAsBindDataClosure - rename —
rename
n2n\bind\mapper\impl\compose — composing sub-plans
- sub-props —
subProps(and the deprecatedsubProp) - sub-props-for-class —
subPropsForClass,subPropsFromClass - sub-foreach —
subForeach - factory-closure —
factoryClosure - from-bind-data-closure —
fromBindDataClosure
n2n\bind\mapper\impl\mod — modifying the bind structure
- value-to-sub-values —
valueToSubValues - sub-merge —
subMerge,subMergeToObject - delete —
delete
n2n\bind\mapper\impl\op — control flow
- do-if —
doIf,doIfNull,doIfNotNull,doIfValueClosure,doIfInvalid,doIfBindableClosure,deleteIf,deleteIfValueClosure,deleteIfBindableClosure - abort-if —
abortIfInvalid,abortIfDirty - must-exist-if —
mustExistIf,mustExistAllIfAnyExist - value-if-not-exists —
valueIfNotExists