Location: PHPKode > projects > DIY Blog > diy-blog/classes/diy-blog/backend/view/postList/PostListView.class.php
<?php

/**
 * Blog Post listing view.
 * @package diy-blog.backend.view.postList
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

class PostListView extends BackEndView
{
	protected $criteria = null;
	
	public function __construct(Resource $resource = null)
	{
		parent::__construct($resource);
		$this->criteria = new Criteria();

		$this->template->load(APP_VIEW_DIR."postList/PostList.xsl");
	}

	public function display(Request $request, Response $response)
	{
		$users = UserPeer::doSelect(new Criteria()); //QUIRK!!!

		$this->criteria->add(PagePeer::TYPE, PagePeer::CLASSKEY_POSTPAGE);
		$this->criteria->addDescendingOrderByColumn(PagePeer::DATETIME);
		//$this->criteria->addDescendingOrderByColumn(PageTitlePeer::TITLE);

		$posts = PagePeer::doSelectJoinAll($this->criteria);
		//$posts = PagePeer::doSelectJoinChildren($this->criteria);

		$this->resolver->setArgument("posts", XMLSerializer::serialize($posts));
		$this->resolver->setArgument("users", XMLSerializer::serialize($users));

		parent::display($request, $response);
		$response->setStatus(Response::SC_OK);
	}

}

?>
Return current item: DIY Blog