public function save($model)
    {
        if (isset($model->{$this->key})) {
            return $this->update($model);
        }
        
        return $this->create($model);
    }
public function save($model)
    {
        if (isset($model->{$this->key})) {
            return $this->update($model);
        }
        
        return $this->create($model);
    }
public function save ( $ model ) { if ( isset ( $ model -> { $ this -> key } ) ) { return $ this -> update ( $ model ) ; } return $ this -> create ( $ model ) ; }
Save entry by inserting if ID is missing and updating if ID exists.

@param mixed $model  Model instance.

@return void
Save entry by inserting if ID is missing and updating if ID exists .