protected function where_pri($fields = false, $where_val = false, $glue = 'AND', $index = false)
    {

        if ($fields !== false && $where_val !== false)
        {
            $fdata = $this->_parse_field_names($fields, 'where_pri');
            foreach ($fdata as $fitem)
            {
                if ($index)
                {
                    $this->where_pri[$index] = array(
                        'table' => $fitem['table'],
                        'field' => $fitem['field'],
                        'value' => isset($fitem['value']) ? $fitem['value'] : $where_val,
                        'glue' => $glue);
                }
                else
                {
                    $this->where_pri[] = array(
                        'table' => $fitem['table'],
                        'field' => $fitem['field'],
                        'value' => isset($fitem['value']) ? $fitem['value'] : $where_val,
                        'glue' => $glue);
                }
            }
            unset($fields, $fdata);
        }
        elseif ($fields)
        {
            if ($index)
            {
                $this->where_pri[$index] = array('custom' => $fields, 'glue' => $glue);
            }
            else
            {
                $this->where_pri[] = array('custom' => $fields, 'glue' => $glue);
            }
            unset($where_val);
        }
        return $this;
    }
protected function where_pri($fields = false, $where_val = false, $glue = 'AND', $index = false)
    {

        if ($fields !== false && $where_val !== false)
        {
            $fdata = $this->_parse_field_names($fields, 'where_pri');
            foreach ($fdata as $fitem)
            {
                if ($index)
                {
                    $this->where_pri[$index] = array(
                        'table' => $fitem['table'],
                        'field' => $fitem['field'],
                        'value' => isset($fitem['value']) ? $fitem['value'] : $where_val,
                        'glue' => $glue);
                }
                else
                {
                    $this->where_pri[] = array(
                        'table' => $fitem['table'],
                        'field' => $fitem['field'],
                        'value' => isset($fitem['value']) ? $fitem['value'] : $where_val,
                        'glue' => $glue);
                }
            }
            unset($fields, $fdata);
        }
        elseif ($fields)
        {
            if ($index)
            {
                $this->where_pri[$index] = array('custom' => $fields, 'glue' => $glue);
            }
            else
            {
                $this->where_pri[] = array('custom' => $fields, 'glue' => $glue);
            }
            unset($where_val);
        }
        return $this;
    }
protected function where_pri ( $ fields = false , $ where_val = false , $ glue = 'AND' , $ index = false ) { if ( $ fields !== false && $ where_val !== false ) { $ fdata = $ this -> _parse_field_names ( $ fields , 'where_pri' ) ; foreach ( $ fdata as $ fitem ) { if ( $ index ) { $ this -> where_pri [ $ index ] = array ( 'table' => $ fitem [ 'table' ] , 'field' => $ fitem [ 'field' ] , 'value' => isset ( $ fitem [ 'value' ] ) ? $ fitem [ 'value' ] : $ where_val , 'glue' => $ glue ) ; } else { $ this -> where_pri [ ] = array ( 'table' => $ fitem [ 'table' ] , 'field' => $ fitem [ 'field' ] , 'value' => isset ( $ fitem [ 'value' ] ) ? $ fitem [ 'value' ] : $ where_val , 'glue' => $ glue ) ; } } unset ( $ fields , $ fdata ) ; } elseif ( $ fields ) { if ( $ index ) { $ this -> where_pri [ $ index ] = array ( 'custom' => $ fields , 'glue' => $ glue ) ; } else { $ this -> where_pri [ ] = array ( 'custom' => $ fields , 'glue' => $ glue ) ; } unset ( $ where_val ) ; } return $ this ; }
defines primary condition for internal usage
defines primary condition for internal usage