Example #1
0
 /**
  * Retrieve the content of this paste.
  * @return string The content of this paste.
  * @throws \Brush\Exceptions\ValidationException If this paste is private.
  */
 public function getContent()
 {
     if (parent::getContent() === null) {
         if ($this->getVisibility() === Visibility::VISIBILITY_PRIVATE) {
             throw new ValidationException('The Pastebin API does not support retrieving the contents of private pastes.');
         }
         $this->loadContent();
     }
     return parent::getContent();
 }
Example #2
0
 /**
  * Retrieve the content of this paste.
  * @return string The content of this paste.
  */
 public function getContent()
 {
     if (parent::getContent() === null) {
         $this->loadContent();
     }
     return parent::getContent();
 }
Example #3
0
File: Paste.php Project: gebn/brush
 /**
  * Retrieve the content of this paste.
  * @param \Brush\Accounts\Developer $developer If this is a private paste and the content is being accessed
  *                                             for the first time, a developer must be passed.
  * @return string The content of this paste.
  * @throws \Brush\Exceptions\ValidationException If this paste is private.
  */
 public function getContent(Developer $developer = null)
 {
     if (parent::getContent() === null) {
         if ($this->getVisibility() === Visibility::VISIBILITY_PRIVATE) {
             if ($developer === null) {
                 throw new ValidationException('A developer instance must be passed the first time the contents ' . 'of a private paste are retrieved');
             }
             $this->setContent(self::getPrivateContent($developer, $this));
         } else {
             $this->setContent(self::getPublicContent($this));
         }
     }
     return parent::getContent();
 }