public function save(Model $model)
    {
        $database = $model->getSourceDB();
        $pkey = $model->getID();

        if ($database === null || $database !== $this->db)
            $this->insert($model);
        else
            $this->update($model);

        return $this;
    }
public function save(Model $model)
    {
        $database = $model->getSourceDB();
        $pkey = $model->getID();

        if ($database === null || $database !== $this->db)
            $this->insert($model);
        else
            $this->update($model);

        return $this;
    }
public function save ( Model $ model ) { $ database = $ model -> getSourceDB ( ) ; $ pkey = $ model -> getID ( ) ; if ( $ database === null || $ database !== $ this -> db ) $ this -> insert ( $ model ) ; else $ this -> update ( $ model ) ; return $ this ; }
Save the current record to the database.

@param Wedeto\DB\Model $model The model instance to save.
If the model does not have a source
database, it is inserted, otherwise
an update is executed.
@return Wedeto\DB\DAO Provides fluent interface
Save the current record to the database .