PrivateBin\Model\Comment::setParentId PHP Метод

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

Set parent ID.
public setParentId ( string $id ) : void
$id string
Результат void
    public function setParentId($id)
    {
        if (!self::isValidId($id)) {
            throw new Exception('Invalid paste ID.', 65);
        }
        $this->_data->meta->parentid = $id;
    }

Usage Example

Пример #1
0
 /**
  * Get a comment, optionally a specific instance.
  *
  * @access public
  * @param string $parentId
  * @param string $commentId
  * @throws Exception
  * @return Comment
  */
 public function getComment($parentId, $commentId = null)
 {
     if (!$this->exists()) {
         throw new Exception('Invalid data.', 62);
     }
     $comment = new Comment($this->_conf, $this->_store);
     $comment->setPaste($this);
     $comment->setParentId($parentId);
     if ($commentId !== null) {
         $comment->setId($commentId);
     }
     return $comment;
 }