Location: PHPKode > projects > DIY Blog > diy-blog/classes/diy-blog/model/PostListResource.php
<?php

require_once 'diy-blog/model/FrontEndResource.php';

require_once 'diy-blog/model/om/BaseFrontEndResource.php';

/**
 * A frontend Resource for diplaying a list of PostPages.
 * Originally generated by Propel.
 *
 * @package	diy-blog.model
 * @author	Martynas Jusevicius <hide@address.com>
 * @link	http://www.xml.lt
 */

class PostListResource extends FrontEndResource
{

	/**
	 * Constructs a new PostListResource class, setting the Type column to FrontEndResourcePeer::CLASSKEY_POSTLISTRESOURCE.
	 */
	public function __construct()
	{

		$this->setType(FrontEndResourcePeer::CLASSKEY_POSTLISTRESOURCE);
	}

	public static function getInstance()
	{
		$c = new Criteria();
		$c->add(FrontEndResourcePeer::TYPE, FrontEndResourcePeer::CLASSKEY_POSTLISTRESOURCE);
		return FrontEndResourcePeer::doSelectOne($c);
	}

	public function doGet(Request $request, Response $response)
	{
		$view = null;
		$parent = parent::doGet($request, $response);

		if ($parent != null) $view = $parent;
		else $view = new PostListView($this);

		if ($request->getParameter("view") == "rss") $view = new RSSView($this);

		return $view;

	}

	public function doPost(Request $request, Response $response)
	{
		$view = null;
		$parent = parent::doPost($request, $response);

		if ($parent != null) $view = $parent;
		else $view = new PostListView($this);

		return $view;
	}

} // PostListResource
Return current item: DIY Blog