Skip to content

Commit

Permalink
Change target to reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Mitchum committed Feb 8, 2016
1 parent f67660f commit 0ac286b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ViewPlugin extends Plugin
/**
* @var Page
*/
private $target;
private $reference;

/**
* Implements 'getSubscribedEvents' event.
Expand Down Expand Up @@ -153,10 +153,10 @@ private function getCollection($page) {

// Check if reference root.
if ($reference !== '/') {
// Set the target page, used for filtering.
$this->target = $page->find($reference);
// Set the reference page, used for filtering.
$this->reference = $page->find($reference);
/* @var Collection $collection */
$collection = $this->target->collection($params, $pagination);
$collection = $this->reference->collection($params, $pagination);
} else {
/* @var Collection $collection */
$collection = $page->collection($params, $pagination);
Expand Down Expand Up @@ -204,9 +204,9 @@ public function onPageProcessed($event) {
public function filter($value, $key) {

/* @var Collection $children */
$children = $this->target->children();
$children = $this->reference->children();

// If key is not in target page collection, filter it from results.
// If key is not in reference page collection, filter it from results.
if ($children->offsetGet($key)) {
return true;
} else {
Expand Down

0 comments on commit 0ac286b

Please sign in to comment.