src/Backend/Modules/CommercePickup/Domain/Pickup/Factory/PickupShipmentMethodFactory.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 PickupShipmentMethodDataTransferObject(null, Locale::fromString('en'));
                $dto->name = $attributes['name'];
                $dto->isEnabled = $attributes['isEnabled'];
                $dto->vatId = $attributes['vatId'];
                return ShipmentMethod::fromDataTransferObject($dto);
            });
    }
protected function initialize ( ) : self { return $ this -> instantiateWith ( function ( array $ attributes ) { $ dto = new PickupShipmentMethodDataTransferObject ( null , Locale :: fromString ( 'en' ) ) ; $ dto -> name = $ attributes [ 'name' ] ; $ dto -> isEnabled = $ attributes [ 'isEnabled' ] ; $ dto -> vatId = $ attributes [ 'vatId' ] ; return ShipmentMethod :: fromDataTransferObject ( $ dto ) ; } ) ; }
Our entities use private properties, no setters and a private constructor.
Our entities use private properties no setters and a private constructor .