/**
  * @param Wiki    $wiki
  * @param Section $section
  */
 public function __construct(Wiki $wiki, Section $section)
 {
     $details = array('section' => array('wiki' => $wiki->getId(), 'id' => $section->getId(), 'title' => $section->getActiveContribution()->getTitle(), 'text' => $section->getActiveContribution()->getText(), 'author' => $section->getAuthor()->getFirstName() . ' ' . $section->getAuthor()->getLastName()));
     parent::__construct($wiki->getResourceNode(), $details);
 }
 /**
  * @param Wiki    $wiki
  * @param Section $section
  * @param array   $changeSet
  */
 public function __construct(Wiki $wiki, Section $section, $changeSet)
 {
     $details = array('section' => array('wiki' => $wiki->getId(), 'id' => $section->getId(), 'title' => $section->getActiveContribution()->getTitle(), 'text' => $section->getActiveContribution()->getText(), 'visible' => $section->getVisible(), 'changeSet' => $changeSet));
     parent::__construct($wiki->getResourceNode(), $details);
 }
Example #3
0
 /**
  * Returns the changeSet data when a section has been moved.
  *
  * @param Section $oldParent
  * @param int     $oldLeft
  * @param Section $newParent
  *
  * @return array $changeSet
  */
 public function getMoveEventChangeSet(Section $oldParent, $oldLeft, Section $newParent)
 {
     /* Create change set for move log event
      * If section's parent has changed, return old and new parent
      * Otherwise return old and new left to mark move up or down in the same parent
      */
     $newLeft = $this->getLeft();
     $changeSet = array('parentId' => array($oldParent->getId(), $newParent->getId()), 'parentName' => array($oldParent->getActiveContribution()->getTitle(), $newParent->getActiveContribution()->getTitle()), 'isParentRoot' => array($oldParent->isRoot(), $newParent->isRoot()), 'left' => array($oldLeft, $newLeft));
     return $changeSet;
 }
 /**
  * @param Wiki    $wiki
  * @param Section $section
  */
 public function __construct(Wiki $wiki, Section $section)
 {
     $this->wiki = $wiki;
     $this->details = array('section' => array('wiki' => $wiki->getId(), 'id' => $section->getId(), 'title' => $section->getActiveContribution()->getTitle(), 'text' => $section->getActiveContribution()->getText(), 'visible' => $section->getVisible()));
     parent::__construct($wiki->getResourceNode(), $this->details);
 }
 /**
  * @param Wiki         $wiki
  * @param Section      $section
  * @param Contribution $contribution
  */
 public function __construct(Wiki $wiki, Section $section, Contribution $contribution)
 {
     $this->wiki = $wiki;
     $this->details = array('contribution' => array('wiki' => $wiki->getId(), 'section' => $section->getId(), 'id' => $contribution->getId(), 'title' => $contribution->getTitle(), 'text' => $contribution->getText(), 'contributor' => $contribution->getContributor()->getFirstName() . ' ' . $contribution->getContributor()->getLastName()));
     parent::__construct($wiki->getResourceNode(), $this->details);
 }