public function save(array $data = [], array $params = [], array $where = [])
    {
        if (empty($where)) {
            return $this
                ->createQuery(
                    $this->getQueryBuilder()
                        ->insert(array() === $data ? $this->data : $data)
                        ->from($this->getTable())
                )
                ->setParameter([] === $params ? $this->params : $params)
                ->execute()
                ->getId();
        }

        return $this
            ->createQuery(
                $this
                    ->getQueryBuilder()
                    ->update(array() === $data ? $this->data : $data)
                    ->from($this->getTable())
                    ->where($where)
            )
            ->setParameter([] === $params ? $this->params : $params)
            ->execute()
            ->getAffected()
            ;
    }
public function save(array $data = [], array $params = [], array $where = [])
    {
        if (empty($where)) {
            return $this
                ->createQuery(
                    $this->getQueryBuilder()
                        ->insert(array() === $data ? $this->data : $data)
                        ->from($this->getTable())
                )
                ->setParameter([] === $params ? $this->params : $params)
                ->execute()
                ->getId();
        }

        return $this
            ->createQuery(
                $this
                    ->getQueryBuilder()
                    ->update(array() === $data ? $this->data : $data)
                    ->from($this->getTable())
                    ->where($where)
            )
            ->setParameter([] === $params ? $this->params : $params)
            ->execute()
            ->getAffected()
            ;
    }
public function save ( array $ data = [ ] , array $ params = [ ] , array $ where = [ ] ) { if ( empty ( $ where ) ) { return $ this -> createQuery ( $ this -> getQueryBuilder ( ) -> insert ( array ( ) === $ data ? $ this -> data : $ data ) -> from ( $ this -> getTable ( ) ) ) -> setParameter ( [ ] === $ params ? $ this -> params : $ params ) -> execute ( ) -> getId ( ) ; } return $ this -> createQuery ( $ this -> getQueryBuilder ( ) -> update ( array ( ) === $ data ? $ this -> data : $ data ) -> from ( $ this -> getTable ( ) ) -> where ( $ where ) ) -> setParameter ( [ ] === $ params ? $ this -> params : $ params ) -> execute ( ) -> getAffected ( ) ; }
Save row into table.

@param array $data
@param array $params
@param array $where
@return bool|int
Save row into table .