/** * {@inheritdoc} */ public function convertToPHPValue($value, AbstractPlatform $platform) { if ($value === null) { return null; } return DayOfWeek::of($value); }
/** * @return DayOfWeek */ public function getDayOfWeek() { return DayOfWeek::of(Math::floorMod($this->toEpochDay() + 3, 7) + 1); }
/** * @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)); }