Implemented JsonSerializable interface for models/records

This commit is contained in:
Gregory Oschwald
2013-10-26 14:13:56 -07:00
parent 7fa971aef8
commit 569043cb8f
4 changed files with 47 additions and 3 deletions
+6 -1
View File
@@ -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;
}
}