forException() public static method

.
public static forException ( Exception $exception ) : static
$exception Exception The exception that caused this exception.
return static The new exception.
 /**
  * {@inheritdoc}
  */
 public function keys()
 {
     try {
         return $this->clientKeys();
     } catch (Exception $e) {
         throw ReadException::forException($e);
     }
 }
 /**
  * {@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);
     }
 }