예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function convertToPHPValue($value, AbstractPlatform $platform)
 {
     if ($value === null) {
         return null;
     }
     return DayOfWeek::of($value);
 }
예제 #2
0
 /**
  * @return DayOfWeek
  */
 public function getDayOfWeek()
 {
     return DayOfWeek::of(Math::floorMod($this->toEpochDay() + 3, 7) + 1);
 }
예제 #3
0
 /**
  * @dataProvider providerToString
  *
  * @param integer $dayOfWeek    The day-of-week value, from 1 to 7.
  * @param string  $expectedName The expected name.
  */
 public function testToString($dayOfWeek, $expectedName)
 {
     $this->assertSame($expectedName, (string) DayOfWeek::of($dayOfWeek));
 }