Doctrine without setters

I read about Domain Driven Design and that objects should not have setters. It makes sense to pass properties in the constructor so that the object is solid. Is there a way to use Doctrine ORM with this practice?

class User
{
    private $firstname;

    public function __construct($firstname)
    {
        $this->firstname = $firstname;
    }
}

How will Doctrine handle this setup? Any flaws?

+4
source share
1 answer

You will encounter many shortcomings, for example:

+13

All Articles