src/Budkit/Datastore/Activerecord.php
final public function having($key, $value = '', $type = 'AND ', $escape = TRUE)
    {
        if (!is_array($key)) {
            $key = array($key => $value);
        }

        foreach ($key as $k => $v) {
            $prefix = (count($this->arrayHaving) == 0) ? '' : $type;

            if ($escape === TRUE) {
                $k = $this->identifiers($k);
            }

            if (!$this->hasOperator($k)) {
                $k .= ' = ';
            }

            if ($v != '') {
                $v = ' ' . $this->escape($v);
            }

            $this->arrayHaving[] = $prefix . $k . $v;
            if ($this->arrayCaching === TRUE) {
                $this->arrayCacheHaving[] = $prefix . $k . $v;
                $this->arrayCacheExists[] = 'having';
            }
        }

        return $this;
    }
final public function having($key, $value = '', $type = 'AND ', $escape = TRUE)
    {
        if (!is_array($key)) {
            $key = array($key => $value);
        }

        foreach ($key as $k => $v) {
            $prefix = (count($this->arrayHaving) == 0) ? '' : $type;

            if ($escape === TRUE) {
                $k = $this->identifiers($k);
            }

            if (!$this->hasOperator($k)) {
                $k .= ' = ';
            }

            if ($v != '') {
                $v = ' ' . $this->escape($v);
            }

            $this->arrayHaving[] = $prefix . $k . $v;
            if ($this->arrayCaching === TRUE) {
                $this->arrayCacheHaving[] = $prefix . $k . $v;
                $this->arrayCacheExists[] = 'having';
            }
        }

        return $this;
    }
final public function having ( $ key , $ value = '' , $ type = 'AND ' , $ escape = TRUE ) { if ( ! is_array ( $ key ) ) { $ key = array ( $ key => $ value ) ; } foreach ( $ key as $ k => $ v ) { $ prefix = ( count ( $ this -> arrayHaving ) == 0 ) ? '' : $ type ; if ( $ escape === TRUE ) { $ k = $ this -> identifiers ( $ k ) ; } if ( ! $ this -> hasOperator ( $ k ) ) { $ k .= ' = ' ; } if ( $ v != '' ) { $ v = ' ' . $ this -> escape ( $ v ) ; } $ this -> arrayHaving [ ] = $ prefix . $ k . $ v ; if ( $ this -> arrayCaching === TRUE ) { $ this -> arrayCacheHaving [ ] = $ prefix . $ k . $ v ; $ this -> arrayCacheExists [ ] = 'having' ; } } return $ this ; }
Adds a having clause to a query statement

@param string $key
@param mixed $value
@param string $type
@param boolean $escape
@return ActiveRecord
Adds a having clause to a query statement