To use transaction or not.

@param boolean $yn Yes or no, keep default that we get this value.

@return  boolean
961096
public function useTransaction($yn = null)
    {
        if ($yn !== null) {
            $this->useTransaction = (bool) $yn;
        }

        return $this->useTransaction;
    }
259126
public function confirmAction($text, $defaultValue = 'yes')
    {
        $defaultValueStr = '';
        if ($defaultValue != '') {
            $defaultValueStr = '[' . $defaultValue . '] ';
        }
        
        echo $text . ' (yes/no) ' . $defaultValueStr;
        
        $handle = fopen('php://stdin', 'r');
        $line = fgets($handle);
        $preparedLine = strtolower(trim($line));
        
        if ($preparedLine === '') {
            $preparedLine = $defaultValue;
        }
        
        if ($preparedLine === 'yes' || $preparedLine === 'y') {
            return true;
        }
        
        return false;
    }
778484
public function commitTransaction()
    {

        if (empty($this->transactions) || !is_array($this->transactions)) {
            throw new QueryException(t("No transaction queries found"));
            $this->transactions = array();


            $this->resourceId->autocommit(TRUE); //Turns autocommit back on
            return false;
        }
        //Query transactions
        foreach ($this->transactions as $query) {


            if (!$this->exec($query)) {

                $this->resourceId->rollback(); //Rolls back the transaction;
                $this->transactions = array();
                $this->resourceId->autocommit(TRUE); //Turns autocommit back on


                return false;
            }
        }

        //Commit the transaction
        if (!$this->resourceId->commit()) {
            throw new QueryException(t("The transaction could not be committed"));
            $this->transactions = array();
            $this->resourceId->autocommit(TRUE); //Turns autocommit back on
            return false;
        }

        $this->transactions = array();
        $this->resourceId->autocommit(TRUE); //Turns autocommit back on
        return true;
    }
1208584
public function commitTransaction() {
		$request = new CPS_CommitTransactionRequest();
		$this->_lastResponse = $this->_connection->sendRequest($request);
		return true;
	}
104496
static boolean tx(Config config, int transactionLevel, IAtom atom) {
		return MAIN.tx(config, transactionLevel, atom);
	}
219840
public function query($sql, $execute = FALSE)
    {

        $query = (empty($sql)) ? $this->query : $sql;
        $this->transactions[] = $this->replacePrefix($query); //just for reference

        //@TODO;
        if ($execute) {
            $this->exec($query);
        }

        return true;
    }
828745
public static function isNationalTransaction($iban1, $iban2)
    {
        // remove whitespaces
        $iban1 = preg_replace('#\s+#','',$iban1);
        $iban2 = preg_replace('#\s+#','',$iban2);

        // check the country code
        if(stripos($iban1,substr($iban2,0,2)) === 0)
            return true;
        else
            return false;
    }
291697
protected function booleanValue($val)
    {
        if (is_numeric($val)) {
            return (bool) $val;
        } else {
            return (in_array(strtolower($val), array('true', 't', 'y', 'yes'), true) ? true : false);
        }
    }
264561
protected function _begin( $fname = false )
    {
        if ( $fname )
            $fname .= "::_begin";
        else
            $fname = "_begin";
        $this->transactionCount++;
        if ( $this->transactionCount == 1 )
            $this->_query( "BEGIN", $fname );
    }
1296228
public function getValueOfXForY($yValue) {
		return pow((($yValue + $this->_Yoffset) / $this->getIntersect()),(1 / $this->getSlope()));
	}
717814
public function rollbackTransaction()
    {
        $this->connect();
        if (!$this->_connection->inTransaction()) {
            return false;
        }

        return $this->_connection->rollBack();
    }
1060855
public function getBooleanValue($value)
    {
        if ($value === null) {
            return;
        }

        if ($this->listData) {
            reset($this->listData);
            list(, $yes_value) = @each($this->listData);
            list(, $no_value) = @each($this->listData);
            if ($no_value === null) {
                $no_value = '';
            }
            /* not to convert N to Y */
            if ($yes_value == $value) {
                return $yes_value;
            }
            if ($no_value == $value) {
                return $no_value;
            }
        } else {
            $yes_value = 1;
            $no_value = 0;
        }

        return $value ? $yes_value : $no_value;
    }
1036802
public static function isBool($input) {
        if(is_bool($input)) {
            return $input; //Already a boolean
        }
        if(is_int($input) || is_float($input)) {
            return $input != 0;
        }
        $input = strtolower(self::isString($input));
        return in_array($input, array('active', 'true', 'yes', '1', 'on', 'y'), TRUE);
    }
1244707
public function confirm(string $text, string $default = 'y'): bool
    {
        $choice = $this->choice($text, ['y', 'n'], $default, false);

        return \strtolower($choice[0] ?? $default) === 'y';
    }
675539
public function true(string $error = 'not true') : Boolean
    {
        return $this->pipe(
            self::predicate(
                function (bool $bool) : bool {
                    return !!$bool;
                },
                $error
            )
        );
    }
360050
public function check(bool $value = true)
    {
        if ($value == false) {
            unset($this->attributes['checked']);
        } else {
            $this->attributes['checked'] = $value;
        }
    }
851526
public function addY($y){
        if(!is_numeric($y)){
            throw new \Exception("Falscher Dateityp (".gettype($y).") number expected!");
        }
        $this->y[] = $y;
        return true;
    }