August 2016
Intermediate to advanced
610 pages
11h 55m
English
A mapper or data mapper works in much the same manner as a hydrator: converting data from one model, be it array or object, into another. A critical difference is that the hydrator is generic and does not need to have object property names pre-programmed, whereas the mapper is the opposite: it needs precise information on property names for both models. In this recipe we will demonstrate the use of a mapper to convert data from one database table into another.
Application\Database\Mapper\FieldConfig class, which contains mapping instructions for individual fields. We also define appropriate class constants:namespace Application\Database\Mapper; use InvalidArgumentException; class FieldConfig { ...Read now
Unlock full access