Hey guys, I am wondering why does this works:
<?php
class ArticleHolder extends Page {
private static $allowed_children = array('ArticlePage');
}
class ArticleHolder_Controller extends Page_Controller {
public function PaginatedPages() {
$results = ArticlePage::get()->sort('Date DESC');
$paginatedItems = new PaginatedList($results, $this->request);
$paginatedItems->setPageLength(3);
return $paginatedItems;
}
}
and then this does not
<?php
class ArticleHolder extends Page {
private static $allowed_children = array('ArticlePage');
}
class ArticleHolder_Controller extends Page_Controller {
public function PaginatedPages() {
$results = Testing();
$paginatedItems = new PaginatedList($results, $this->request);
$paginatedItems->setPageLength(3);
return $paginatedItems;
}
public function Testing(){
return ArticlePage::get()->sort('Date DESC');
}
}
Any thoughts?