public function save($model, $id, $data)
    {
        if (is_null($id)) { // insert
            $model->data = $this->sendCollectionRequest($model, $this->insert_mode, $data);
            $model->id = $model->data ? $model->data[$model->id_field] : null;
        } else { // update
            $model->data = $this->sendItemRequest($model, $id, $this->update_mode, $data);
            $model->id = $model->data ? $model->data[$model->id_field] : null;
        }

        return $model->id;
    }
public function save($model, $id, $data)
    {
        if (is_null($id)) { // insert
            $model->data = $this->sendCollectionRequest($model, $this->insert_mode, $data);
            $model->id = $model->data ? $model->data[$model->id_field] : null;
        } else { // update
            $model->data = $this->sendItemRequest($model, $id, $this->update_mode, $data);
            $model->id = $model->data ? $model->data[$model->id_field] : null;
        }

        return $model->id;
    }
public function save ( $ model , $ id , $ data ) { if ( is_null ( $ id ) ) { // insert $ model -> data = $ this -> sendCollectionRequest ( $ model , $ this -> insert_mode , $ data ) ; $ model -> id = $ model -> data ? $ model -> data [ $ model -> id_field ] : null ; } else { // update $ model -> data = $ this -> sendItemRequest ( $ model , $ id , $ this -> update_mode , $ data ) ; $ model -> id = $ model -> data ? $ model -> data [ $ model -> id_field ] : null ; } return $ model -> id ; }
Saving, updating and deleting data
Saving updating and deleting data