Example #1
0
 public function update($data)
 {
     $data_array = $this->convertDataToArray($data);
     if (!isset($data_array['data']['objectId'])) {
         throw new BackendlessException('Missing objectId property value for update');
     }
     $this->cheackTargetTable($data_array['table'], __METHOD__);
     // if call method of() check target table and  table in data structure
     $this->unsetTableName();
     //delete table name if user call mehod of()
     return BackendlessCollection::prepareSingleItem(RequestBuilder::doRequest('data', $data_array['table'] . '/' . $data_array['data']['objectId'], $data_array['data'], 'PUT'), $data_array["type"]);
 }