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

.
public static forException ( Exception $exception ) : static
$exception Exception The exception that caused this exception.
Результат static The new exception.
 /**
  * {@inheritdoc}
  */
 public function keys()
 {
     try {
         return $this->clientKeys();
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function keys()
 {
     try {
         $cursor = $this->collection->find(array(), array('projection' => array('_id' => 1)));
         $keys = array();
         foreach ($cursor as $document) {
             $keys[] = $document['_id'];
         }
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
     return $keys;
 }
Пример #3
0
 private function getDbRow($key)
 {
     try {
         $dbResult = $this->connection->fetchAssoc('SELECT meta_value, meta_key FROM ' . $this->tableName . ' WHERE meta_key = ?', array($key));
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
     if (empty($dbResult)) {
         return null;
     }
     return $dbResult;
 }
Пример #4
0
 /**
  * {@inheritdoc}
  */
 public function keys()
 {
     try {
         return $this->client->bucket($this->bucketName)->getKeys();
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
 }