Mapping/Driver/AnnotationDriver.php
public function loadMetadataForClass($className)
    {
        $class = new ReflectionClass($className);
        $classAnnotations = $this->reader->getClassAnnotations($class);

        if ($classAnnotations) {
            foreach ($classAnnotations as $key => $annot) {
                if ( ! is_numeric($key)) {
                    continue;
                }

                $classAnnotations[get_class($annot)] = $annot;
            }
        }

        if (!isset($classAnnotations['ML\HydraBundle\Mapping\Expose'])) {
            return null;
        }

        $annotation = $classAnnotations['ML\HydraBundle\Mapping\Expose'];

        $metadata = new ClassMetadata($className);
        $metadata->setExposeAs($annotation->as);
        $metadata->setIri($annotation->getIri());

        $this->documentRouteAndOperations($metadata, $class);
        $this->documentProperties($metadata, $class);


        // If this class represents an external definition, we don't need to
        // collect all data; just the one necessary for the serializer
        if ($metadata->isExternalReference()) {
            return $metadata;
        }

        $docu = $this->getDocBlockText($class);

        $metadata->setTitle($docu['title']);
        $metadata->setDescription($docu['description']);

        return $metadata;
    }
public function loadMetadataForClass($className)
    {
        $class = new ReflectionClass($className);
        $classAnnotations = $this->reader->getClassAnnotations($class);

        if ($classAnnotations) {
            foreach ($classAnnotations as $key => $annot) {
                if ( ! is_numeric($key)) {
                    continue;
                }

                $classAnnotations[get_class($annot)] = $annot;
            }
        }

        if (!isset($classAnnotations['ML\HydraBundle\Mapping\Expose'])) {
            return null;
        }

        $annotation = $classAnnotations['ML\HydraBundle\Mapping\Expose'];

        $metadata = new ClassMetadata($className);
        $metadata->setExposeAs($annotation->as);
        $metadata->setIri($annotation->getIri());

        $this->documentRouteAndOperations($metadata, $class);
        $this->documentProperties($metadata, $class);


        // If this class represents an external definition, we don't need to
        // collect all data; just the one necessary for the serializer
        if ($metadata->isExternalReference()) {
            return $metadata;
        }

        $docu = $this->getDocBlockText($class);

        $metadata->setTitle($docu['title']);
        $metadata->setDescription($docu['description']);

        return $metadata;
    }
{@inheritDoc}