Doctrine\ODM\OrientDB\Mapper\MappingException::missingRid PHP Метод

missingRid() публичный статический Метод

public static missingRid ( $class )
    public static function missingRid($class)
    {
        return new self(sprintf('The identifier mapping for %s could not be found.', $class));
    }

Usage Example

 protected function populateMetadata(ClassMetadata $metadata)
 {
     $associations = array();
     $fields = array();
     $foundIdentifier = false;
     foreach ($metadata->getReflectionClass()->getProperties() as $refProperty) {
         $annotation = $this->getPropertyAnnotation($refProperty);
         if ($annotation) {
             if ('@rid' === $annotation->name) {
                 $foundIdentifier = true;
                 $metadata->setIdentifier($refProperty->getName());
                 $fields[$refProperty->getName()] = $annotation;
             } elseif (in_array($annotation->type, $this->getAssociationTypes())) {
                 $associations[$refProperty->getName()] = $annotation;
             } else {
                 $fields[$refProperty->getName()] = $annotation;
             }
         }
     }
     if (!$foundIdentifier) {
         throw MappingException::missingRid($metadata->getName());
     }
     $metadata->setFields($fields);
     $metadata->setAssociations($associations);
     return $associations;
 }