public static function Serialize($obj) { $dto = new \stdClass(); $dto->Id = Primitives::WriteInt($obj->Id); $dto->ClassId = Primitives::WriteInt($obj->ClassId); $dto->TeacherId = Primitives::WriteInt($obj->TeacherId); $dto->RoomId = Primitives::WriteInt($obj->RoomId); $dto->RoomName = Primitives::WriteString($obj->RoomName); $dto->Date = Primitives::WriteLocalDate($obj->Date); $dto->StartTime = Primitives::WriteLocalTime($obj->StartTime); $dto->EndTime = Primitives::WriteLocalTime($obj->EndTime); $dto->IsDeleted = Primitives::WriteBoolean($obj->IsDeleted); return $dto; }
public function testCanWriteLocalTimeAsInteger() { $timestamp = 1435661461; $written = Primitives::WriteLocalTime($timestamp); $this->assertEquals('10:51:01.000000', $written); }