Esempio n. 1
0
 /**
  * Apply the values stored in a chunk of XML to this object.
  * @param \DOMElement $paste The `<paste>` element from Pastebin to parse.
  */
 protected function parse(DOMElement $paste)
 {
     parent::parse($paste);
     $this->setKey($paste->getElementsByTagName('paste_key')->item(0)->nodeValue);
     $this->setDate($paste->getElementsByTagName('paste_date')->item(0)->nodeValue);
     $this->setSize($paste->getElementsByTagName('paste_size')->item(0)->nodeValue);
     $this->setExpires($paste->getElementsByTagName('paste_expire_date')->item(0)->nodeValue);
     $this->setHits($paste->getElementsByTagName('paste_hits')->item(0)->nodeValue);
 }
Esempio n. 2
0
 /**
  * Add the values in this paste to a new paste request.
  * @param \Crackle\Requests\POSTRequest $request The request to add variables to.
  * @param \Brush\Accounts\Developer $developer The developer that will send the request.
  */
 protected function addTo(POSTRequest $request, Developer $developer)
 {
     parent::addTo($request, $developer);
     $request->getVariables()->set('api_paste_expire_date', $this->getExpiry());
 }