src/Phossa/Query/Clause/WhereTrait.php
protected function buildWhere(/*# string */ $clause = 'where')/*# : array */
    {
        $result = [];
        if (!empty($this->clause_{$clause})) {
            foreach ($this->clause_{$clause} as $idx => $where) {
                $cls = [];

                // logic
                if ($idx) {
                    $cls[] = $where[2] ? 'AND' : 'OR';
                }

                // NOT
                if ($where[1]) {
                    $cls[] = 'NOT';
                }

                // grouped where
                if (is_object($where[3])) {
                    $cls[] = $where[3]->getStatement([], false);

                } elseif (!is_null($where[3])) {
                    $cls[] = $where[0] ? $where[3] : $this->quote($where[3]);
                }

                // operator
                if (ClauseInterface::NO_OPERATOR !== $where[4]) {
                    $cls[] = (empty($col) ? '' : ' ') . $where[4];
                }

                // val part
                if (ClauseInterface::NO_VALUE !== $where[5]) {
                    $cls[] = $this->processValue($where[5]);
                }

                $result[] = join(' ', $cls);
            }
        }
        return $result;
    }
protected function buildWhere(/*# string */ $clause = 'where')/*# : array */
    {
        $result = [];
        if (!empty($this->clause_{$clause})) {
            foreach ($this->clause_{$clause} as $idx => $where) {
                $cls = [];

                // logic
                if ($idx) {
                    $cls[] = $where[2] ? 'AND' : 'OR';
                }

                // NOT
                if ($where[1]) {
                    $cls[] = 'NOT';
                }

                // grouped where
                if (is_object($where[3])) {
                    $cls[] = $where[3]->getStatement([], false);

                } elseif (!is_null($where[3])) {
                    $cls[] = $where[0] ? $where[3] : $this->quote($where[3]);
                }

                // operator
                if (ClauseInterface::NO_OPERATOR !== $where[4]) {
                    $cls[] = (empty($col) ? '' : ' ') . $where[4];
                }

                // val part
                if (ClauseInterface::NO_VALUE !== $where[5]) {
                    $cls[] = $this->processValue($where[5]);
                }

                $result[] = join(' ', $cls);
            }
        }
        return $result;
    }
Build WHERE

@param  string $clause 'where|having'
@return array
@access protected