本文整理汇总了PHP中TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::getPerson方法的典型用法代码示例。如果您正苦于以下问题:PHP Questionnaire::getPerson方法的具体用法?PHP Questionnaire::getPerson怎么用?PHP Questionnaire::getPerson使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire
的用法示例。
在下文中一共展示了Questionnaire::getPerson方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCreateQuestionnaire
public function testCreateQuestionnaire()
{
$this->createQuestionnaire();
$this->assertNotNull($this->result);
$this->assertStringStartsWith('FIRST_NAME ', $this->result->getPerson()->getFirstName());
$this->assertNotEmpty($this->result->getId());
}
示例2: populateAddressDetailsFromPostCode
/**
* @param Questionnaire $questionnaire
* @return Questionnaire
*/
public function populateAddressDetailsFromPostCode(Questionnaire $questionnaire)
{
$address = $questionnaire->getPerson()->getAddress();
if ($this->hasPostCode($address) && $this->loadAuthorityForPostCode($address)) {
$questionnaire->getPerson()->setAddress($address);
}
return $questionnaire;
}
示例3: testGetSetPerson
public function testGetSetPerson()
{
$expected = (new Person())->setTitle("Title")->setFirstName("First")->setLastName("Last")->setGender("F")->setAge(75);
$this->assertNotEmpty($this->instance->getPerson());
$this->assertNotEquals($expected, $this->instance->getPerson());
$this->assertTrue($this->instance->setPerson($expected) instanceof Questionnaire);
$this->assertEquals($expected, $this->instance->getPerson());
}
示例4: addSignedInCompletedRecords
/**
* @param Questionnaire $questionnaire
* @param Document $document
*/
protected function addSignedInCompletedRecords(Questionnaire $questionnaire, Document &$document)
{
if (true === $questionnaire->isCompleted() && true === $questionnaire->getPerson()->isSignedUp()) {
$document->addRecord(new Record($questionnaire, $this->getContainer()->get('translator')));
}
$this->updateQuestionnaireAddressAndStatus($questionnaire);
}
示例5: isSatisfiedBy
/**
* @inheritDoc
*/
public static function isSatisfiedBy(Questionnaire $questionnaire)
{
$maxUnits = DrinkingScore::getDailyMaxUnits($questionnaire->getDrinking());
$gender = $questionnaire->getPerson()->getGender();
switch ($gender) {
case Person::GENDER_FEMALE:
return $maxUnits > DrinkingScore::DAILY_CUTOFF_UNITS_FEMALE;
case Person::GENDER_MALE:
return $maxUnits > DrinkingScore::DAILY_CUTOFF_UNITS_MALE;
}
}
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:14,代码来源:DrinkingExceedsDailyLimitsForGenderSpecification.php
示例6: isSatisfiedBy
/**
* @inheritDoc
*/
public static function isSatisfiedBy(Questionnaire $questionnaire)
{
return self::unitsInLowRiskForGender($questionnaire->getPerson(), $questionnaire->getDrinking());
}
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:DrinkingUnitsInLowerRiskForGenderSpecification.php
示例7: testSpecificationReturnsTrue
public function testSpecificationReturnsTrue()
{
$questionnaire = new Questionnaire(new Person());
$questionnaire->getPerson()->setGender('female');
$this->assertTrue($this->instance->isSatisfiedBy($questionnaire));
}
示例8: getPreferredDrinkType
/**
* @JMS\VirtualProperty
* @JMS\SerializedName("preffered_drink_type")
*
* Which drink type has the most captured in any drinks collection
* @return string
* @JMS\Groups({"api_response"})
*/
public function getPreferredDrinkType()
{
$drinkType = DrinkingScore::calculatePreferredDrinkType($this);
$gender = $this->questionnaire->getPerson()->getGender();
return array('type' => $drinkType, 'count' => (int) DrinkingScore::getDisplayUnits($gender, $drinkType));
}
示例9: testSubstitutionOfThreeOrMoreMotivations
public function testSubstitutionOfThreeOrMoreMotivations()
{
$questionnaire = new Questionnaire(new Person());
$questionnaire->getPerson()->setGender('male');
$questionnaire->getMoving()->setCompletedDate(new \DateTime());
$questionnaire->getEating()->setCompletedDate(new \DateTime());
$questionnaire->getDrinking()->setCompletedDate(new \DateTime());
$questionnaire->getSmoking()->setCompletedDate(new \DateTime());
$questionnaire->getAboutYou()->getMotivations()->setAlertness(true)->setAppearance(true)->setWeight(true)->setEnergy(true);
$priorityCopy = $this->instance->buildNarrative($questionnaire)->getSubstitutions()['{{PRIORITY_COPY}}'];
$this->assertEquals(1, substr_count($priorityCopy, 'and'));
$this->assertEquals(1, substr_count($priorityCopy, ', '));
}
示例10: isSatisfiedBy
/**
* @inheritDoc
*/
public static function isSatisfiedBy(Questionnaire $questionnaire)
{
return $questionnaire->getPerson()->getGender() === 'male';
}
示例11: testICanGetAnRedNarrativeAsAMaleDrinker
public function testICanGetAnRedNarrativeAsAMaleDrinker()
{
$questionnaire = new Questionnaire(new Person());
$questionnaire->getPerson()->setGender('male');
$questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setWeight(20);
$drinks = new Drinks();
$drinks->setBeerCiderPintAmount(80)->setSpiritsAmount(30);
$questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('mon, tues, wed, thurs, fri, sat, sun')->setWeekdayDrinks($drinks)->setWeekendDrinks($drinks)->setCompletedDate(new \DateTime());
$expected = array('drinking' => array('drinking_red_min_weight_gt_5_days_male'));
$this->assertEquals($expected, $this->instance->buildNarrative($questionnaire)->getMessages());
}