Karaka-Management / phpOMS

PHP Framework
Other
2 stars 0 forks source link

Some models may require special initialization. For such cases a model factory should be implemented and used by the data mapper. One solution could be to create a default `ModelFactory` which behaves as the current DataMapper functions which set/update the model members. This factory could be extended in case custom behavior becomes necessary. In the Mapper you would just have to define a `const FACTORY` constant which references the factory to use (instead of the default one). Since there hasn't been a situation where this was necessary it will not be implemented until we actually need this (it would additional overhead which maybe never becomes necessary) #289

Closed spl1nes closed 1 year ago

spl1nes commented 1 year ago

Implemented by defining a FACTORY in the mapper which has a createWith() function. Since this is never used, it might get removed later on again especially if the performance hit is too big.