src/Serializer/Serializer.php
private function getClassProperties($class)
    {
        $properties = $this->getCache()->get('_PHX.serialze_properties.'. $class);
        if (!isset($properties)) {
            $classResolver = $this->getClassResolver();
            $properties = $this->getReflectionProperties($class);
            foreach ($this->getAnnotations()->get($class) as $annotation) {
                if ($annotation instanceof IsA) {
                    $properties[$this->getAnnotationProperty($annotation)]['type']
                        = $classResolver->resolve($annotation->class, $annotation->getDeclaringClass());
                } elseif ($annotation instanceof IsArray && is_scalar($annotation->element)) {
                    $name = $this->getAnnotationProperty($annotation);
                    $properties[$name]['type'] = 'array';
                    $properties[$name]['element']
                        = $classResolver->resolve($annotation->element, $annotation->getDeclaringClass());
                } elseif ($annotation instanceof SerializeName) {
                    $properties[$this->getAnnotationProperty($annotation)]['serializeName']
                        = $annotation->value;
                }
            }
            $this->getCache()->save('_PHX.serialze_properties.'.$class, $properties);
        }
        return $properties;
    }
private function getClassProperties($class)
    {
        $properties = $this->getCache()->get('_PHX.serialze_properties.'. $class);
        if (!isset($properties)) {
            $classResolver = $this->getClassResolver();
            $properties = $this->getReflectionProperties($class);
            foreach ($this->getAnnotations()->get($class) as $annotation) {
                if ($annotation instanceof IsA) {
                    $properties[$this->getAnnotationProperty($annotation)]['type']
                        = $classResolver->resolve($annotation->class, $annotation->getDeclaringClass());
                } elseif ($annotation instanceof IsArray && is_scalar($annotation->element)) {
                    $name = $this->getAnnotationProperty($annotation);
                    $properties[$name]['type'] = 'array';
                    $properties[$name]['element']
                        = $classResolver->resolve($annotation->element, $annotation->getDeclaringClass());
                } elseif ($annotation instanceof SerializeName) {
                    $properties[$this->getAnnotationProperty($annotation)]['serializeName']
                        = $annotation->value;
                }
            }
            $this->getCache()->save('_PHX.serialze_properties.'.$class, $properties);
        }
        return $properties;
    }
private function getClassProperties ( $ class ) { $ properties = $ this -> getCache ( ) -> get ( '_PHX.serialze_properties.' . $ class ) ; if ( ! isset ( $ properties ) ) { $ classResolver = $ this -> getClassResolver ( ) ; $ properties = $ this -> getReflectionProperties ( $ class ) ; foreach ( $ this -> getAnnotations ( ) -> get ( $ class ) as $ annotation ) { if ( $ annotation instanceof IsA ) { $ properties [ $ this -> getAnnotationProperty ( $ annotation ) ] [ 'type' ] = $ classResolver -> resolve ( $ annotation -> class , $ annotation -> getDeclaringClass ( ) ) ; } elseif ( $ annotation instanceof IsArray && is_scalar ( $ annotation -> element ) ) { $ name = $ this -> getAnnotationProperty ( $ annotation ) ; $ properties [ $ name ] [ 'type' ] = 'array' ; $ properties [ $ name ] [ 'element' ] = $ classResolver -> resolve ( $ annotation -> element , $ annotation -> getDeclaringClass ( ) ) ; } elseif ( $ annotation instanceof SerializeName ) { $ properties [ $ this -> getAnnotationProperty ( $ annotation ) ] [ 'serializeName' ] = $ annotation -> value ; } } $ this -> getCache ( ) -> save ( '_PHX.serialze_properties.' . $ class , $ properties ) ; } return $ properties ; }
gets class properties metadata
gets class properties metadata