src/Backend/Modules/Commerce/Domain/OrderStatus/Factory/OrderStatusFactory.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 OrderStatusDataTransferObject();
                $dto->title = $attributes['title'];
                $dto->color = $attributes['color'];
                return OrderStatus::fromDataTransferObject($dto);
            });
    }
protected function initialize ( ) : self { return $ this -> instantiateWith ( function ( array $ attributes ) { $ dto = new OrderStatusDataTransferObject ( ) ; $ dto -> title = $ attributes [ 'title' ] ; $ dto -> color = $ attributes [ 'color' ] ; return OrderStatus :: fromDataTransferObject ( $ dto ) ; } ) ; }
Our entities use private properties, no setters and a private constructor.
Our entities use private properties no setters and a private constructor .