public static getInstance ( ) : Google\Spreadsheet\ServiceRequestInterface | ||
Результат | Google\Spreadsheet\ServiceRequestInterface |
public static function getInstance()
{
if (is_null(self::$instance)) {
throw new Exception();
}
return self::$instance;
}
/** * Insert a new row into this feed * * @param array $row * * @return void */ public function insert($row) { $entry = '<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended">'; foreach ($row as $colName => $value) { $entry .= sprintf('<gsx:%s><![CDATA[%s]]></gsx:%s>', $colName, $value, $colName); } $entry .= '</entry>'; ServiceRequestFactory::getInstance()->post($this->getPostUrl(), $entry); }