src/Tools/ClassMetadata/ClassMetadata.php
private function processClassAnnotation($annotation)
    {
        $class = get_class($annotation);
        switch ($class) {
            case "JPC\MongoDB\ODM\Annotations\Mapping\Document":
                $this->collectionInfo->setCollection($annotation->collectionName);

                if (null !== ($rep = $annotation->repositoryClass)) {
                    $this->collectionInfo->setRepository($annotation->repositoryClass);
                } else {
                    if (class_exists($this->getName() . 'Repository')) {
                        $this->collectionInfo->setRepository($this->getName() . 'Repository');
                    } else {
                        $this->collectionInfo->setRepository("JPC\MongoDB\ODM\Repository");
                    }
                }

                if (null !== ($rep = $annotation->hydratorClass)) {
                    $this->collectionInfo->setHydrator($annotation->hydratorClass);
                } else {
                    $this->collectionInfo->setHydrator("JPC\MongoDB\ODM\Hydrator");
                }

                $this->checkCollectionCreationOptions($annotation);
                break;
            case "JPC\MongoDB\ODM\GridFS\Annotations\Mapping\Document":
                $this->collectionInfo->setBucketName($annotation->bucketName);
                $this->collectionInfo->setCollection($annotation->bucketName . ".files");

                if (null !== ($rep = $annotation->repositoryClass)) {
                    $this->collectionInfo->setRepository($annotation->repositoryClass);
                } else {
                    $this->collectionInfo->setRepository("JPC\MongoDB\ODM\GridFS\Repository");
                }

                if (null !== ($rep = $annotation->hydratorClass)) {
                    $this->collectionInfo->setHydrator($annotation->hydratorClass);
                } else {
                    $this->collectionInfo->setHydrator("JPC\MongoDB\ODM\GridFS\Hydrator");
                }
                break;
            case "JPC\MongoDB\ODM\Annotations\Mapping\Option":
                $this->processOptionAnnotation($annotation);
                break;
            case "JPC\MongoDB\ODM\Annotations\Event\HasLifecycleCallbacks":
                $this->hasEvent = true;
                break;
        }
    }
private function processClassAnnotation($annotation)
    {
        $class = get_class($annotation);
        switch ($class) {
            case "JPC\MongoDB\ODM\Annotations\Mapping\Document":
                $this->collectionInfo->setCollection($annotation->collectionName);

                if (null !== ($rep = $annotation->repositoryClass)) {
                    $this->collectionInfo->setRepository($annotation->repositoryClass);
                } else {
                    if (class_exists($this->getName() . 'Repository')) {
                        $this->collectionInfo->setRepository($this->getName() . 'Repository');
                    } else {
                        $this->collectionInfo->setRepository("JPC\MongoDB\ODM\Repository");
                    }
                }

                if (null !== ($rep = $annotation->hydratorClass)) {
                    $this->collectionInfo->setHydrator($annotation->hydratorClass);
                } else {
                    $this->collectionInfo->setHydrator("JPC\MongoDB\ODM\Hydrator");
                }

                $this->checkCollectionCreationOptions($annotation);
                break;
            case "JPC\MongoDB\ODM\GridFS\Annotations\Mapping\Document":
                $this->collectionInfo->setBucketName($annotation->bucketName);
                $this->collectionInfo->setCollection($annotation->bucketName . ".files");

                if (null !== ($rep = $annotation->repositoryClass)) {
                    $this->collectionInfo->setRepository($annotation->repositoryClass);
                } else {
                    $this->collectionInfo->setRepository("JPC\MongoDB\ODM\GridFS\Repository");
                }

                if (null !== ($rep = $annotation->hydratorClass)) {
                    $this->collectionInfo->setHydrator($annotation->hydratorClass);
                } else {
                    $this->collectionInfo->setHydrator("JPC\MongoDB\ODM\GridFS\Hydrator");
                }
                break;
            case "JPC\MongoDB\ODM\Annotations\Mapping\Option":
                $this->processOptionAnnotation($annotation);
                break;
            case "JPC\MongoDB\ODM\Annotations\Event\HasLifecycleCallbacks":
                $this->hasEvent = true;
                break;
        }
    }
private function processClassAnnotation ( $ annotation ) { $ class = get_class ( $ annotation ) ; switch ( $ class ) { case "JPC\MongoDB\ODM\Annotations\Mapping\Document" : $ this -> collectionInfo -> setCollection ( $ annotation -> collectionName ) ; if ( null !== ( $ rep = $ annotation -> repositoryClass ) ) { $ this -> collectionInfo -> setRepository ( $ annotation -> repositoryClass ) ; } else { if ( class_exists ( $ this -> getName ( ) . 'Repository' ) ) { $ this -> collectionInfo -> setRepository ( $ this -> getName ( ) . 'Repository' ) ; } else { $ this -> collectionInfo -> setRepository ( "JPC\MongoDB\ODM\Repository" ) ; } } if ( null !== ( $ rep = $ annotation -> hydratorClass ) ) { $ this -> collectionInfo -> setHydrator ( $ annotation -> hydratorClass ) ; } else { $ this -> collectionInfo -> setHydrator ( "JPC\MongoDB\ODM\Hydrator" ) ; } $ this -> checkCollectionCreationOptions ( $ annotation ) ; break ; case "JPC\MongoDB\ODM\GridFS\Annotations\Mapping\Document" : $ this -> collectionInfo -> setBucketName ( $ annotation -> bucketName ) ; $ this -> collectionInfo -> setCollection ( $ annotation -> bucketName . ".files" ) ; if ( null !== ( $ rep = $ annotation -> repositoryClass ) ) { $ this -> collectionInfo -> setRepository ( $ annotation -> repositoryClass ) ; } else { $ this -> collectionInfo -> setRepository ( "JPC\MongoDB\ODM\GridFS\Repository" ) ; } if ( null !== ( $ rep = $ annotation -> hydratorClass ) ) { $ this -> collectionInfo -> setHydrator ( $ annotation -> hydratorClass ) ; } else { $ this -> collectionInfo -> setHydrator ( "JPC\MongoDB\ODM\GridFS\Hydrator" ) ; } break ; case "JPC\MongoDB\ODM\Annotations\Mapping\Option" : $ this -> processOptionAnnotation ( $ annotation ) ; break ; case "JPC\MongoDB\ODM\Annotations\Event\HasLifecycleCallbacks" : $ this -> hasEvent = true ; break ; } }
Process class annotation to extract infos

@param   Annotation $annotation Annotation to process
@return  void
Process class annotation to extract infos