FWQ
创建专注的领域应用程序 Symfony 方法(保存实体)
介绍 在本系列的第三篇文章中,我们将创建一个准备好从我们在本系列第一篇文章中创建的 dto 持久保存到数据库的实体。 将 userinputdto 转换为实体 从本节开始,我们假设我们正在使用原则与数据库进行通信,并且我们的 user 实体如下所示: #[ormentity(repositoryclass: userrepository::class)] class user { #[ormid] #[ormgeneratedvalue] #[ormcolumn] private ?int $id = null; #[ormcolumn(length: 150)] private string $firstname;…