src/Budkit/Datastore/Drivers/MySQLi/Table.php
public function save($data = null)
    {

        //1. Check if we have data and deal with it!
        if (!is_null($data)) {
            if (!$this->bindData($data)) {
                //we could not save the data
                return false;
            }
        }
        //2. Check if the primary key has a value
        $primary = $this->keys();

        //3. if the primary key has a value, then we are updating, else we are inserting
        if (isset($primary->Value) && !empty($primary->Value)) {
            return $this->update($primary->Value);
        } else {
            return $this->insert();
        }
        //if we get here then there is a problem
        return false;
    }
public function save($data = null)
    {

        //1. Check if we have data and deal with it!
        if (!is_null($data)) {
            if (!$this->bindData($data)) {
                //we could not save the data
                return false;
            }
        }
        //2. Check if the primary key has a value
        $primary = $this->keys();

        //3. if the primary key has a value, then we are updating, else we are inserting
        if (isset($primary->Value) && !empty($primary->Value)) {
            return $this->update($primary->Value);
        } else {
            return $this->insert();
        }
        //if we get here then there is a problem
        return false;
    }
public function save ( $ data = null ) { //1. Check if we have data and deal with it! if ( ! is_null ( $ data ) ) { if ( ! $ this -> bindData ( $ data ) ) { //we could not save the data return false ; } } //2. Check if the primary key has a value $ primary = $ this -> keys ( ) ; //3. if the primary key has a value, then we are updating, else we are inserting if ( isset ( $ primary -> Value ) && ! empty ( $ primary -> Value ) ) { return $ this -> update ( $ primary -> Value ) ; } else { return $ this -> insert ( ) ; } //if we get here then there is a problem return false ; }
Saves changes to the database

@param type $data
@return type
Saves changes to the database