/** * Inserts a new row with provided data. * * @param array $rowData An array of column header to row data * @param string $key The key of the spreadsheet to modify * @param string $wkshtId (optional) The worksheet to modify * @return ListEntry The inserted row */ public function insertRow($rowData, $key, $wkshtId = 'default') { $newEntry = new ListEntry(); $newCustomArr = array(); foreach ($rowData as $k => $v) { $newCustom = new Extension\Custom(); $newCustom->setText($v)->setColumnName($k); $newEntry->addCustom($newCustom); } $query = new ListQuery(); $query->setSpreadsheetKey($key); $query->setWorksheetId($wkshtId); $feed = $this->getListFeed($query); $editLink = $feed->getLink('http://schemas.google.com/g/2005#post'); return $this->insertEntry($newEntry->saveXML(), $editLink->href, '\\Zend\\GData\\Spreadsheets\\ListEntry'); }