Example #1
0
 protected function listFromMethod(\DataObject $object, $limit = 5)
 {
     $list = [];
     if ($object->AllChildrenIncludingDeleted()->limit($limit)->exists()) {
         foreach ($object->AllChildrenIncludingDeleted()->limit($limit) as $child) {
             $data = $child instanceof \RedirectorPage ? $child->ContentSource() : $child;
             $list[] = $this->process($data);
         }
     }
     return $list;
 }
Example #2
0
	/**
	 * Mark all children of the given node that match the marking filter.
	 * @param DataObject $node Parent node.
	 */
	public function markChildren($node, $context = null) {
		$children = $node->AllChildrenIncludingDeleted($context);
		$node->markExpanded();
		if($children) {
			foreach($children as $child) {
				if(!$this->markingFilter || $this->markingFilterMatches($child)) {
					$child->markUnexpanded();
					$this->markedNodes[$child->ID] = $child;
				}
			}
		}
	}