public function values(array $values)
    {
        $this->fieldValues = array();

        $this->fieldsSql   = '?i';
        $this->fieldValues[] = array_keys($values);

        $this->valuesSql   = array();

        foreach ($values as $v) {
            if (is_object($v) and $v instanceof SqlValueInterface) {
                $this->valuesSql[] = $v->getSql();
                $this->fieldValues = array_merge($this->fieldValues, $v->getValues());
            } else {
                $this->valuesSql[]   = '?q';
                $this->fieldValues[] = $v;
            }
        }

        $this->valuesSql = implode(', ', $this->valuesSql);

        return $this;
    }
public function values(array $values)
    {
        $this->fieldValues = array();

        $this->fieldsSql   = '?i';
        $this->fieldValues[] = array_keys($values);

        $this->valuesSql   = array();

        foreach ($values as $v) {
            if (is_object($v) and $v instanceof SqlValueInterface) {
                $this->valuesSql[] = $v->getSql();
                $this->fieldValues = array_merge($this->fieldValues, $v->getValues());
            } else {
                $this->valuesSql[]   = '?q';
                $this->fieldValues[] = $v;
            }
        }

        $this->valuesSql = implode(', ', $this->valuesSql);

        return $this;
    }
public function values ( array $ values ) { $ this -> fieldValues = array ( ) ; $ this -> fieldsSql = '?i' ; $ this -> fieldValues [ ] = array_keys ( $ values ) ; $ this -> valuesSql = array ( ) ; foreach ( $ values as $ v ) { if ( is_object ( $ v ) and $ v instanceof SqlValueInterface ) { $ this -> valuesSql [ ] = $ v -> getSql ( ) ; $ this -> fieldValues = array_merge ( $ this -> fieldValues , $ v -> getValues ( ) ) ; } else { $ this -> valuesSql [ ] = '?q' ; $ this -> fieldValues [ ] = $ v ; } } $ this -> valuesSql = implode ( ', ' , $ this -> valuesSql ) ; return $ this ; }
Prepares values for inserting into db
@param array $values
@return $this
Prepares values for inserting into db