diff --git a/components/serializer.rst b/components/serializer.rst index 98935c75aaa..88360575def 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -72,6 +72,7 @@ exists in your project:: private $age; private $name; private $sportsman; + private $createdAt; // Getters public function getName() @@ -84,6 +85,11 @@ exists in your project:: return $this->age; } + public function getCreatedAt() + { + return $this->createdAt; + } + // Issers public function isSportsman() { @@ -105,6 +111,11 @@ exists in your project:: { $this->sportsman = $sportsman; } + + public function setCreatedAt($createdAt) + { + $this->createdAt = $createdAt; + } } Now, if you want to serialize this object into JSON, you only need to