final public function execute(string $query, string $exceptionMessage = '')
    {
        $return = $this->queryAffectedRows($query);
        if (false === $return) {
            if ('' !== $exceptionMessage) {
                $previous = $this->getLastErrorMessage() ? new \RuntimeException($this->getLastErrorMessage()) : null;
                throw new QueryException($exceptionMessage, $query, 0, $previous);
            }
            return false;
        }

        $this->logger->info("-- AffectedRows: $return");
        return $return;
    }
final public function execute(string $query, string $exceptionMessage = '')
    {
        $return = $this->queryAffectedRows($query);
        if (false === $return) {
            if ('' !== $exceptionMessage) {
                $previous = $this->getLastErrorMessage() ? new \RuntimeException($this->getLastErrorMessage()) : null;
                throw new QueryException($exceptionMessage, $query, 0, $previous);
            }
            return false;
        }

        $this->logger->info("-- AffectedRows: $return");
        return $return;
    }
final public function execute ( string $ query , string $ exceptionMessage = '' ) { $ return = $ this -> queryAffectedRows ( $ query ) ; if ( false === $ return ) { if ( '' !== $ exceptionMessage ) { $ previous = $ this -> getLastErrorMessage ( ) ? new \ RuntimeException ( $ this -> getLastErrorMessage ( ) ) : null ; throw new QueryException ( $ exceptionMessage , $ query , 0 , $ previous ) ; } return false ; } $ this -> logger -> info ( "-- AffectedRows: $return" ) ; return $ return ; }
Executes a query and return the affected rows

@param string $query
@param string $exceptionMessage Throws QueryException with message on error
@return int|false Number of affected rows or FALSE on error
@throws \RuntimeException if the result is FALSE and the $exceptionMessage was set
Executes a query and return the affected rows