Skip to main content

Mappers

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 a RetryValueChanger until the value satisfies a uniqueness/validity check.

n2n\bind\mapper\impl\string — string & format validation​

n2n\bind\mapper\impl\numeric — numbers​

n2n\bind\mapper\impl\type — type enforcement​

  • type — type, typeNotNull

n2n\bind\mapper\impl\enum — enumerations​

n2n\bind\mapper\impl\date — dates & times​

n2n\bind\mapper\impl\l10n — locale​

n2n\bind\mapper\impl\closure — closures over values & props​

  • value — value, valueIfNotNull (and the deprecated valueClosure, valueNotNullClosure)
  • bindable — bindable, bindableIfNotNull (and the deprecated bindableClosure, bindableNotNullClosure)
  • bindables — bindables / closure (and the deprecated bindablesClosure)
  • values — values, valuesAny, valuesEvery, propsAsBindDataClosure (and the deprecated propsClosure)
  • value-as-bind-data — valueAsBindDataClosure
  • rename — rename

n2n\bind\mapper\impl\compose — composing sub-plans​

n2n\bind\mapper\impl\mod — modifying the bind structure​

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

n2n\bind\mapper\impl\valobj — value objects​