private function generateSetter($propertyName) { return 'set' . Utils::CamelCase($propertyName); }
public function jsonSerialize() { $reflected = new \ReflectionClass($this); $properties = $reflected->getProperties(); $stdClass = new \stdClass(); foreach ($properties as $property) { $name = $property->getName(); /** * Skip all internal properties. */ if (substr($name, 0, 2) === '__') { continue; } $getter = 'get' . Utils::CamelCase($name); $value = $this->{$getter}(); if (empty($value)) { continue; } $stdClass->{$name} = $this->_doPrepareJsonData($value); } return $stdClass; }