Doctrine\ODM\OrientDB\Caster\Caster::convertJsonCollectionToArray PHP Method

convertJsonCollectionToArray() protected method

If a JSON value is converted in an object containing other objects to hydrate, this method converts the main object in an array.
    protected function convertJsonCollectionToArray()
    {
        if (!is_array($this->value) && is_object($this->value)) {
            $orientObjects = array();
            $refClass = new \ReflectionObject($this->value);
            $properties = $refClass->getProperties(\ReflectionProperty::IS_PUBLIC);
            foreach ($properties as $property) {
                $orientObjects[$property->name] = $this->value->{$property->name};
            }
            $this->setValue($orientObjects);
        }
    }