RequestType.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2006-2007 by Konstantin V. Arkhipov                     *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  ***************************************************************************/
00011 /* $Id: RequestType.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00016     final class RequestType extends Enumeration
00017     {
00018         const GET       = 1;
00019         const POST      = 2;
00020         const FILES     = 3;
00021         const COOKIE    = 4;
00022         const SESSION   = 5;
00023         const ATTACHED  = 6;
00024         
00025         protected $names = array(
00026             self::GET       => 'get',
00027             self::POST      => 'post',
00028             self::FILES     => 'files',
00029             self::COOKIE    => 'cookie',
00030             self::SESSION   => 'session',
00031             self::ATTACHED  => 'attached'
00032         );
00033         
00037         public static function get()
00038         {
00039             return new self(self::GET);
00040         }
00041         
00045         public static function post()
00046         {
00047             return new self(self::POST);
00048         }
00049         
00053         public static function files()
00054         {
00055             return new self(self::FILES);
00056         }
00057         
00061         public static function cookie()
00062         {
00063             return new self(self::COOKIE);
00064         }
00065         
00069         public static function session()
00070         {
00071             return new self(self::SESSION);
00072         }
00073 
00077         public static function attached()
00078         {
00079             return new self(self::ATTACHED);
00080         }
00081     }
00082 ?>

Generated on Sun Dec 9 21:56:23 2007 for onPHP by  doxygen 1.5.4