src/Backend/Modules/Commerce/Domain/Vat/Factory/VatFactory.php
/**
     * Our entities use private properties, no setters and a private constructor. Therefore, we have to use a DTO
     * object to instantiate our Entity.
     */
Our entities use private properties, no setters and a private constructor. Therefore, we have to use a DTO
object to instantiate our Entity.
Our entities use private properties no setters and a private constructor . Therefore we have to use a DTO object to instantiate our Entity .
protected function initialize(): self
    {
        return $this
            ->instantiateWith(function (array $attributes) {
                $dto = new VatDataTransferObject();
                $dto->id = $attributes['id'];
                $dto->title = $attributes['title'];
                $dto->percentage = $attributes['percentage'];
                $dto->locale = $attributes['locale'];
                $dto->sequence = $attributes['sequence'];
                return Vat::fromDataTransferObject($dto);
            });
    }
protected function initialize ( ) : self { return $ this -> instantiateWith ( function ( array $ attributes ) { $ dto = new VatDataTransferObject ( ) ; $ dto -> id = $ attributes [ 'id' ] ; $ dto -> title = $ attributes [ 'title' ] ; $ dto -> percentage = $ attributes [ 'percentage' ] ; $ dto -> locale = $ attributes [ 'locale' ] ; $ dto -> sequence = $ attributes [ 'sequence' ] ; return Vat :: fromDataTransferObject ( $ dto ) ; } ) ; }
Our entities use private properties, no setters and a private constructor.
Our entities use private properties no setters and a private constructor .