public function getClauseConditionSql(string $conditionType, array $clauseConditions) : string
    {
        if (count($clauseConditions) === 0) {
            return '';
        }

        $sql = ' ' . strtoupper($conditionType);
        // This will help us keep track of whether or not we've added at least one clause
        $haveAddedAClause = false;

        foreach ($clauseConditions as $conditionData) {
            $sql .= ($haveAddedAClause ? ' ' . strtoupper($conditionData['operation']) : '')
                . " ({$conditionData['condition']})";
            $haveAddedAClause = true;
        }

        return $sql;
    }
public function getClauseConditionSql(string $conditionType, array $clauseConditions) : string
    {
        if (count($clauseConditions) === 0) {
            return '';
        }

        $sql = ' ' . strtoupper($conditionType);
        // This will help us keep track of whether or not we've added at least one clause
        $haveAddedAClause = false;

        foreach ($clauseConditions as $conditionData) {
            $sql .= ($haveAddedAClause ? ' ' . strtoupper($conditionData['operation']) : '')
                . " ({$conditionData['condition']})";
            $haveAddedAClause = true;
        }

        return $sql;
    }
public function getClauseConditionSql ( string $ conditionType , array $ clauseConditions ) : string { if ( count ( $ clauseConditions ) === 0 ) { return '' ; } $ sql = ' ' . strtoupper ( $ conditionType ) ; // This will help us keep track of whether or not we've added at least one clause $ haveAddedAClause = false ; foreach ( $ clauseConditions as $ conditionData ) { $ sql .= ( $ haveAddedAClause ? ' ' . strtoupper ( $ conditionData [ 'operation' ] ) : '' ) . " ({$conditionData['condition']})" ; $ haveAddedAClause = true ; } return $ sql ; }
Gets the SQL that makes up a clause that permits boolean operations ie "AND" and "OR"

@param string $conditionType The name of the condition type ie "WHERE"
@param array $clauseConditions The array of condition data whose SQL we want
@return string The SQL that makes up the input clause(s)
Gets the SQL that makes up a clause that permits boolean operations ie AND and OR