public function add($data, $row = null) { $this->_init(); $r = $row ? $row : $this->nextLine; $tmp = array(); foreach ($this->flipHeaders as $name => $col) { if (array_key_exists($name, $data)) { $tmp["R{$r}C{$col}"] = $data[$name]; } } $data = $this->service->update($this->key, $this->wid, $tmp); if (is_null($row) && $data['status'] === 200) { $this->nextLine += 1; } return $data; }