Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PostPage extends Page {
- public static $many_many = array(
- 'Authors' => 'AuthorPage'
- );
- }
- class AuthorPage extends Page {
- public static $belongs_many_many = array(
- 'Posts' => 'PostPage'
- );
- }
- class HomePage_Controller extends Page_Controller {
- public function filterStuff() {
- $results = PostPage::get()->filter(array('Authors.ID:ExactMatch' => 37));
- return $results->renderWith('SomeTemplate');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement