public static function Deserialize($dto) { if ($dto === NULL) { return NULL; } $obj = new Lesson(); $obj->Id = Primitives::ReadInt($dto->Id); $obj->ClassId = Primitives::ReadInt($dto->ClassId); $obj->TeacherId = Primitives::ReadInt($dto->TeacherId); $obj->RoomId = Primitives::ReadInt($dto->RoomId); $obj->RoomName = Primitives::ReadString($dto->RoomName); $obj->Date = Primitives::ReadLocalDate($dto->Date); $obj->StartTime = Primitives::ReadLocalTime($dto->StartTime); $obj->EndTime = Primitives::ReadLocalTime($dto->EndTime); $obj->IsDeleted = Primitives::ReadBoolean($dto->IsDeleted); return $obj; }
public function testCanReadLocalTime() { $localTime = '14:33:21.4979577'; $read = Primitives::ReadLocalTime($localTime); $this->assertEquals('14:33:21.497957', $read->format('H:i:s.u')); }