Google\Spreadsheet\CellFeed::createCell PHP Метод

createCell() публичный Метод

Create a entry to insert data
public createCell ( integer $row, integer $col, string $value ) : CellEntry
$row integer
$col integer
$value string
Результат CellEntry
    public function createCell($row, $col, $value)
    {
        $entry = new \SimpleXMLElement("\n            <entry\n                xmlns=\"http://www.w3.org/2005/Atom\"\n                xmlns:gs=\"http://schemas.google.com/spreadsheets/2006\">\n            </entry>\n        ");
        // use ->content instead of addChild('content', $value)
        // due to addChild not escaping & properly.
        // http://php.net/manual/en/simplexmlelement.addchild.php#112204
        $entry->content = $value;
        $child = $entry->content;
        $child->addAttribute("type", "text");
        $child = $entry->addChild("title");
        $child->addAttribute("type", "text");
        $entry->addChild("id", $this->getPostUrl() . "/R" . $row . "C" . $col);
        $link = $entry->addChild("link");
        $link->addAttribute("rel", "edit");
        $link->addAttribute("type", "application/atom+xml");
        $link->addAttribute("href", $this->getPostUrl() . "/R" . $row . "C" . $col);
        $elementType = "gs:cell";
        $entry->{$elementType} = $value;
        $child = $entry->{$elementType};
        $child->addAttribute("row", $row);
        $child->addAttribute("col", $col);
        $child->addAttribute("inputValue", $value);
        return new CellEntry(new \SimpleXMLElement($entry->asXML()), $this->getPostUrl());
    }