当前位置: 首页>>代码示例>>PHP>>正文


PHP Questionnaire::getMoving方法代码示例

本文整理汇总了PHP中TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::getMoving方法的典型用法代码示例。如果您正苦于以下问题:PHP Questionnaire::getMoving方法的具体用法?PHP Questionnaire::getMoving怎么用?PHP Questionnaire::getMoving使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire的用法示例。


在下文中一共展示了Questionnaire::getMoving方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('male')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setFatigue(100)->setMood(100)->setFitness(100)->setStress(100)->setWeight(35)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('water')->setBreakfastChoice('other')->setCheeseChoice('other')->setProteinChoice('5')->setFruitAndVegChoice('5')->setPotatoesChoice('other')->setDailySnackChoice('')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('no')->setCompletedDate(new \DateTime());
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DRINK_TWO_TO_FOUR_TIMES_A_MONTH)->setBingingFrequency(Drinking::BINGE_L_T_MONTHLY)->setCompletedDate(new \DateTime());
     $moving = array('mon' => 30, 'wed' => 30, 'fri' => 30, 'sun' => 30);
     $this->questionnaire->getMoving()->setAerobicActivityDays($moving)->setStrengtheningActivityDays($moving)->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:14,代码来源:IGetAGreenNarrativeWithAScoreOfEightTest.php

示例2: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('male')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setFatigue(100)->setMood(100)->setFitness(100)->setStress(100)->setWeight(80)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('water')->setBreakfastChoice('other')->setCheeseChoice('other')->setProteinChoice('5')->setFruitAndVegChoice('5')->setPotatoesChoice('other')->setDailySnackChoice('')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('yes')->setCompletedDate(new \DateTime());
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DO_NOT_DRINK)->setWhichDaysDoYouDrink('mon, tue, wed, thur, fri, sat, sun')->setCompletedDate(new \DateTime());
     $moving = array('mon' => 30, 'tue' => 30, 'wed' => 30, 'thur' => 30, 'fri' => 30, 'sat' => 30, 'sun' => 30);
     $this->questionnaire->getMoving()->setAerobicActivityDays($moving)->setStrengtheningActivityDays($moving)->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:14,代码来源:IGetARedRagAndScoreOfThreeBecauseISmokeTest.php

示例3: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('female')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setFatigue(100)->setMood(100)->setFitness(100)->setStress(100)->setWeight(35)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('sugary drink')->setBreakfastChoice('sugary cereal')->setCheeseChoice('hard cheese')->setProteinChoice('ham')->setFruitAndVegChoice('0')->setPotatoesChoice('chips')->setDailySnackChoice('sweets, crisps, cake, biscuits')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('no')->setCompletedDate(new \DateTime());
     $drinks = (new Drinks())->setBeerCiderPintAmount(5)->setBeerCiderBottleAmount(5);
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('thur, fri, sat')->setWeekendDrinks($drinks)->setWeekdayDrinks($drinks)->setCompletedDate(new \DateTime());
     $moving = array('mon' => 40, 'tue' => 40, 'wed' => 40, 'sun' => 40);
     $this->questionnaire->getMoving()->setAerobicActivityDays($moving)->setStrengtheningActivityDays($moving)->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:15,代码来源:IGetAnAmberNarrativeWithAScoreOfFiveTest.php

示例4: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('male')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setEnergy(30)->setFatigue(30)->setMood(30)->setFitness(30)->setStress(30)->setWeight(0)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('water')->setBreakfastChoice('other')->setCheeseChoice('other')->setProteinChoice('5')->setFruitAndVegChoice('5')->setPotatoesChoice('other')->setDailySnackChoice('')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('no')->setCompletedDate(new \DateTime());
     $drinks = new Drinks();
     $drinks->setBeerCiderPintAmount(2);
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWeekdayDrinks($drinks)->setWeekendDrinks($drinks)->setWhichDaysDoYouDrink('mon,  wed, fri, sun')->setCompletedDate(new \DateTime());
     $this->questionnaire->getMoving()->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:15,代码来源:IGetAnAmberNarrativeWithAScoreOfSevenTest.php

示例5: setUp

 public function setUp()
 {
     $this->builder = new NarrativeBuilder();
     $person = new Person();
     $person->setGender('female')->setAge('40')->setFirstName(uniqid('FN_'));
     $this->questionnaire = new Questionnaire($person);
     $this->questionnaire->getAboutYou()->setCompletedDate(new \DateTime());
     $this->questionnaire->getAboutYou()->getFeelings()->setWeight(0)->setCompletedDate(new \DateTime());
     $this->questionnaire->getEating()->setDrinksChoice('sugary drink')->setBreakfastChoice('sugary cereals')->setCheeseChoice('hard cheese')->setProteinChoice('ham')->setFruitAndVegChoice('0')->setPotatoesChoice('chips')->setDailySnackChoice('cake, biscuits, crisps, sweets')->setCompletedDate(new \DateTime());
     $this->questionnaire->getSmoking()->setDoYouSmoke('yes')->setCompletedDate(new \DateTime());
     $drinks = new Drinks();
     $drinks->setBeerCiderPintAmount(5)->setWineAmount(3)->setSpiritsAmount(5)->setCompletedDate(new \DateTime());
     $this->questionnaire->getDrinking()->setDoYouDrink(Drinking::DOES_DRINK)->setWhichDaysDoYouDrink('mon, tue, wed, thur, fri, sat, sun')->setWeekendDrinks($drinks)->setWeekdayDrinks($drinks)->setCompletedDate(new \DateTime());
     $this->questionnaire->getMoving()->setCompletedDate(new \DateTime());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:15,代码来源:IGetARedNarrativeWithAScoreOfOneTest.php

示例6: testSpecificationIsTrue

 public function testSpecificationIsTrue()
 {
     $days = array('mon' => 30, 'tues' => 30, 'wed' => 30);
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getMoving()->setAerobicActivityDays($days);
     $this->assertTrue(AerobicTimeLT150MinsDaysGTE3Specification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:AerobicTimeLT150MinsDaysGTE3SpecificationTest.php

示例7: calculateScore

 /**
  * @inheritdoc
  */
 public function calculateScore(Questionnaire $questionnaire)
 {
     if ($questionnaire->getMoving()->isCompleted()) {
         $this->extractMovingScore($questionnaire);
     }
     return $this->getRag();
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:10,代码来源:MovingScore.php

示例8: testSpecificationIsTrue

 public function testSpecificationIsTrue()
 {
     $days = array('mon' => 80, 'tues' => 80);
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getMoving()->setAerobicActivityDays($days);
     $this->assertTrue(AmberMovingAmberAerobicLowDaysRedStrengthSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:7,代码来源:AmberMovingAmberAerobicLowDaysRedStrengthSpecificationTest.php

示例9: testIGetARedMessageWithFitnessQuestionForMoving

 public function testIGetARedMessageWithFitnessQuestionForMoving()
 {
     $questionnaire = new Questionnaire(new Person());
     $questionnaire->getMoving()->setCompletedDate(new \DateTime());
     $questionnaire->getAboutYou()->getFeelings()->setFitness(21);
     $expected = array('moving' => array('moving_red', 'moving_red_low_fitness'));
     $this->assertEquals($expected, $this->instance->buildNarrative($questionnaire)->getMessages());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:8,代码来源:MovingNarrativeBuilderTest.php

示例10: testCompletedSectionsButNoQuestionnaireDate

 public function testCompletedSectionsButNoQuestionnaireDate()
 {
     $this->instance->getDrinking()->setCompletedDate(new \DateTime());
     $this->instance->getEating()->setCompletedDate(new \DateTime());
     $this->instance->getMoving()->setCompletedDate(new \DateTime());
     $this->instance->getSmoking()->setCompletedDate(new \DateTime());
     $this->assertTrue($this->instance->isCompleted());
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:8,代码来源:QuestionnaireTest.php

示例11: testIHaveLessThan60MinutesAndLessThanThreeDaysIAmAerobicRed

 public function testIHaveLessThan60MinutesAndLessThanThreeDaysIAmAerobicRed()
 {
     $aerobic = array('mon' => 15, 'tue' => 15);
     $questionnaire = new Questionnaire(new Person());
     $moving = $questionnaire->getMoving();
     $moving->setAerobicActivityDays($aerobic)->setCompletedDate(new \DateTime());
     $questionnaire->setMoving($moving);
     $this->assertTrue(AerobicIsRedSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:9,代码来源:AerobicIsRedSpecificationTest.php

示例12: testIHave150MinutesAnd3OrMoreDaysIAmAerobicGreen

 public function testIHave150MinutesAnd3OrMoreDaysIAmAerobicGreen()
 {
     $aerobic = array('mon' => 50, 'tue' => 50, 'wed' => 50);
     $questionnaire = new Questionnaire(new Person());
     $moving = $questionnaire->getMoving();
     $moving->setAerobicActivityDays($aerobic)->setCompletedDate(new \DateTime());
     $questionnaire->setMoving($moving);
     $this->assertTrue(AerobicIsGreenSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:9,代码来源:AerobicIsGreenSpecificationTest.php

示例13: testExtractMoving

 public function testExtractMoving()
 {
     $expectedKeys = array("movingAerobicActivityDuration", "movingAerobicActivityDays", "strengtheningActivityDays", "movingCompleted", "movingRag");
     $questionnaire = new Questionnaire(new Person());
     $export = MovingHelper::extractMoving($questionnaire->getMoving());
     foreach ($expectedKeys as $key) {
         $this->assertArrayHasKey($key, $export);
     }
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:9,代码来源:MovingHelperTest.php

示例14: testIHave60OrMoreMinutesAndLessThanTwoDaysIAmAerobicAmber

 public function testIHave60OrMoreMinutesAndLessThanTwoDaysIAmAerobicAmber()
 {
     $aerobic = array('mon' => 50, 'wed' => 40);
     $questionnaire = new Questionnaire(new Person());
     $moving = $questionnaire->getMoving();
     $moving->setAerobicActivityDays($aerobic)->setCompletedDate(new \DateTime());
     $questionnaire->setMoving($moving);
     $this->assertFalse(AerobicIsGreenSpecification::isSatisfiedBy($questionnaire));
     $this->assertFalse(AerobicIsRedSpecification::isSatisfiedBy($questionnaire));
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:10,代码来源:AerobicIsAmberFunctionalTest.php

示例15: generateScore

 /**
  * @param Questionnaire $questionnaire
  * @return int
  */
 protected function generateScore(Questionnaire $questionnaire)
 {
     $result = 0;
     $result += $questionnaire->getDrinking()->getRagScore()['value'];
     $result += $questionnaire->getMoving()->getRagScore()['value'];
     $result += $questionnaire->getEating()->getRagScore()['value'];
     $result += $questionnaire->getSmoking()->getRagScore()['value'];
     if ($questionnaire->getSmoking()->getRagScore()['rag'] === RagScore::RAG_RED) {
         if ($result > self::RED_CUTOFF) {
             return self::RED_CUTOFF;
         }
     }
     return $result;
 }
开发者ID:TransformCore,项目名称:HayPersistenceApi,代码行数:18,代码来源:QuestionnaireScore.php


注:本文中的TransformCore\PHE\HayApi\PersistenceBundle\Entity\Questionnaire::getMoving方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。