Doctrine\ODM\OrientDB\DocumentNotFoundException::documentNotFound PHP Метод

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

public static documentNotFound ( $className, $identifier )
    public static function documentNotFound($className, $identifier)
    {
        return new self(sprintf('The "%s" document with identifier %s could not be found.', $className, json_encode($identifier)));
    }

Usage Example

Пример #1
0
 /**
  * Generates a closure capable of finalizing a cloned proxy
  *
  * @param ClassMetadata       $class
  * @param DocumentPersister   $documentPersister
  * @param \ReflectionProperty $reflectionId
  *
  * @return callable
  */
 private function createCloner(ClassMetadata $class, DocumentPersister $documentPersister, \ReflectionProperty $reflectionId)
 {
     return function (BaseProxy $proxy) use($reflectionId, $documentPersister, $class) {
         if ($proxy->__isInitialized()) {
             return;
         }
         $proxy->__setInitialized(true);
         $proxy->__setInitializer(null);
         $rid = $reflectionId->getValue($proxy);
         $original = $documentPersister->load($rid);
         if (null === $original) {
             throw DocumentNotFoundException::documentNotFound(get_class($proxy), $rid);
         }
         foreach ($class->reflFields as $name => $property) {
             $property->setValue($proxy, $property->getValue($original));
         }
     };
 }
All Usage Examples Of Doctrine\ODM\OrientDB\DocumentNotFoundException::documentNotFound
DocumentNotFoundException