build/commands/lite/protected/controllers/PostController.php
protected function loadPost()
	{
		if(isset($_GET['id']))
			$post=Post::model()->findbyPk($_GET['id']);
		if(isset($post))
			return $post;
		else
			throw new CHttpException(500,'The requested post does not exist.');
	}
protected function loadPost()
	{
		if(isset($_GET['id']))
			$post=Post::model()->findbyPk($_GET['id']);
		if(isset($post))
			return $post;
		else
			throw new CHttpException(500,'The requested post does not exist.');
	}
protected function loadPost ( ) { if ( isset ( $ _GET [ 'id' ] ) ) $ post = Post :: model ( ) -> findbyPk ( $ _GET [ 'id' ] ) ; if ( isset ( $ post ) ) return $ post ; else throw new CHttpException ( 500 , 'The requested post does not exist.' ) ; }
Loads the data model based on the primary key given in the GET variable.
If the data model is not found, an HTTP exception will be raised.
Loads the data model based on the primary key given in the GET variable . If the data model is not found an HTTP exception will be raised .