/**
  * @param Dependants $dependants
  * @return array
  */
 public static function extractDependants(Dependants $dependants)
 {
     return array("dependantsPartner" => true === $dependants->isPartner() ? "true" : "false", "dependantsKids" => true === $dependants->isKids() ? "true" : "false", "dependantsParents" => true === $dependants->isParents() ? "true" : "false", "dependantsGrandChildren" => true === $dependants->isGrandChildren() ? "true" : "false", "dependantsFriends" => true === $dependants->isFriends() ? "true" : "false", "dependantsSiblings" => true === $dependants->isSiblings() ? "true" : "false", "dependantsPets" => true === $dependants->isPets() ? "true" : "false", "dependantsNotRelevant" => true === $dependants->isNotRelevant() ? "true" : "false", "dependantsCompleted" => true === $dependants->isCompleted() ? "true" : "false");
 }
 public function testGetSetNotRelevant()
 {
     $this->assertFalse($this->instance->isNotRelevant());
     $this->assertTrue($this->instance->setNotRelevant(true) instanceof Dependants);
     $this->assertTrue($this->instance->isNotRelevant());
 }
 /**
  * @param Dependants   $dependants
  * @param ParamFetcher $paramFetcher
  * @return Questionnaire
  * @throws \Exception
  */
 public function updateDependants(Dependants $dependants, ParamFetcher $paramFetcher)
 {
     $entityManager = $this->getEntityManager();
     $dependants->setPartner($paramFetcher->get('partner'))->setKids($paramFetcher->get('kids'))->setParents($paramFetcher->get('parents'))->setGrandChildren($paramFetcher->get('grandchildren'))->setFriends($paramFetcher->get('friends'))->setSiblings($paramFetcher->get('siblings'))->setPets($paramFetcher->get('pets'))->setNotRelevant($paramFetcher->get('relevant'))->setCompletedDate(new \DateTime());
     $entityManager->persist($dependants);
     $entityManager->flush($dependants);
     return $this->getParentQuestionnaireForSection($dependants);
 }
예제 #4
0
 /**
  * @inheritdoc
  */
 public function isCompleted()
 {
     return $this->feelings->isCompleted() && $this->hindrances->isCompleted() && $this->dependants->isCompleted() && $this->motivations->isCompleted();
 }