Kdyby\Doctrine\Connection::query PHP Method

query() public method

public query ( ) : Doctrine\DBAL\Driver\Statement | mixed
return Doctrine\DBAL\Driver\Statement | mixed
    public function query()
    {
        $args = func_get_args();
        try {
            return call_user_func_array('parent::query', $args);
        } catch (\Exception $e) {
            throw $this->resolveException($e, func_get_arg(0));
        }
    }

Usage Example

 /**
  * @return null
  * @throws \Exception
  */
 public function query()
 {
     $stmt = null;
     $args = func_get_args();
     $attempt = 0;
     $retry = true;
     while ($retry) {
         $retry = false;
         try {
             switch (count($args)) {
                 case 1:
                     $stmt = parent::query($args[0]);
                     break;
                 case 2:
                     $stmt = parent::query($args[0], $args[1]);
                     break;
                 case 3:
                     $stmt = parent::query($args[0], $args[1], $args[2]);
                     break;
                 case 4:
                     $stmt = parent::query($args[0], $args[1], $args[2], $args[3]);
                     break;
                 default:
                     $stmt = parent::query();
             }
         } catch (\Exception $e) {
             if ($this->validateReconnectAttempt($e, $attempt)) {
                 $this->close();
                 $attempt++;
                 $retry = true;
             } else {
                 throw $e;
             }
         }
     }
     return $stmt;
 }
All Usage Examples Of Kdyby\Doctrine\Connection::query