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?
source
share