Implemented JsonSerializable interface for models/records
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace GeoIp2\Record;
|
||||
|
||||
abstract class AbstractRecord
|
||||
abstract class AbstractRecord implements \JsonSerializable
|
||||
{
|
||||
private $record;
|
||||
|
||||
@@ -31,4 +31,9 @@ abstract class AbstractRecord
|
||||
throw new \RuntimeException("Unknown attribute: $attr");
|
||||
}
|
||||
}
|
||||
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return $this->record;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user