Пример #1
0
 /**
  * Constructs a document link.
  *
  * @param string  $id       the ID of the linked document
  * @param string  $uid      the UID of the linked document (can be null)
  * @param string  $type     the type of the linked document
  * @param array   $tags     an array of strings which are the document's tags
  * @param string  $slug     the current slug of the document
  * @param array   $fragments the additional fragment data
  * @param boolean $isBroken returns true if the link is towards a document that is not live, for instance
  */
 public function __construct($id, $uid, $type, $tags, $slug, array $fragments, $isBroken)
 {
     parent::__construct($fragments);
     $this->id = $id;
     $this->uid = $uid;
     $this->type = $type;
     $this->tags = $tags;
     $this->slug = $slug;
     $this->isBroken = $isBroken;
 }
Пример #2
0
 /**
  * Constructs a Document object. To be used only for testing purposes, as this gets done during the unmarshalling
  *
  * @param string $id              the ID of the document
  * @param string|null $uid        the user ID of the document
  * @param string $type            the type of the document
  * @param string $href            the URL of the document in the repository's API
  * @param array  $tags            the tags used in the document
  * @param array  $slugs           the slugs used in the document, in the past and today; today's slug is the head
  * @param array  $fragments       all the fragments in the document
  */
 public function __construct($id, $uid, $type, $href, array $tags, array $slugs, array $fragments)
 {
     parent::__construct($fragments);
     $this->id = $id;
     $this->uid = $uid;
     $this->type = $type;
     $this->href = $href;
     $this->tags = $tags;
     $this->slugs = $slugs;
 }