public function testSetDeletedAt() { $project = new Project(); $dateTime = new \DateTime(); $project->setDeletedAt($dateTime); $this->assertEquals($dateTime, $project->getDeletedAt()); }
/** * {@inheritDoc} */ public function load(ObjectManager $manager) { $faker = Factory::create(); for ($i = 0; $i < 10; $i++) { $project = new Project(); $project->setName($faker->sentence(6)); $project->setDescription($faker->paragraph(2)); $project->setCompany($this->getReference('company-' . $faker->numberBetween(0, 9))); $project->setEmployee($this->getReference('employee-' . $faker->numberBetween(0, 9))); $project->setStatus($this->getReference('project-status-' . $i)); $this->addReference('project-' . $i, $project); $manager->persist($project); } $manager->flush(); }
/** * Add projects * * @param Project $project * * @return Employee */ public function addProject(Project $project) { $this->projects[] = $project; $project->setEmployee($this); return $this; }
/** * Add projects * * @param Project $project * @return Company */ public function addProject(Project $project) { $this->projects[] = $project; $project->setCompany($this); return $this; }