/** * @param Motivations $motivations * @param ParamFetcher $paramFetcher * @return Questionnaire * @throws \Exception */ public function updateMotivations(Motivations $motivations, ParamFetcher $paramFetcher) { $entityManager = $this->getEntityManager(); $motivations->setWeight($paramFetcher->get('weight'))->setEnergy($paramFetcher->get('energy'))->setBodyPain($paramFetcher->get('body_pain'))->setFeelYounger($paramFetcher->get('feel_younger'))->setIndependence($paramFetcher->get('independence'))->setAlertness($paramFetcher->get('alertness'))->setSocialLife($paramFetcher->get('social_life'))->setAppearance($paramFetcher->get('appearance'))->setFamily($paramFetcher->get('family'))->setCompletedDate(new \DateTime()); $entityManager->persist($motivations); $entityManager->flush($motivations); return $this->getParentQuestionnaireForSection($motivations); }
public function testGetSetWeight() { $this->assertFalse($this->instance->isWeight()); $this->assertTrue($this->instance->setWeight(true) instanceof Motivations); $this->assertTrue($this->instance->isWeight()); }