ForeignChangeAction.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: ForeignChangeAction.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00016     final class ForeignChangeAction extends Enumeration
00017     {
00018         const NO_ACTION     = 0x01;
00019         const RESTRICT      = 0x02;
00020         const CASCADE       = 0x03;
00021         const SET_NULL      = 0x04;
00022         const SET_DEFAULT   = 0x05;
00023         
00024         protected $names = array(
00025             self::NO_ACTION     => 'NO ACTION', // default one
00026             self::RESTRICT      => 'RESTRICT',
00027             self::CASCADE       => 'CASCADE',
00028             self::SET_NULL      => 'SET NULL',
00029             self::SET_DEFAULT   => 'SET DEFAULT'
00030         );
00031         
00035         public static function noAction()
00036         {
00037             return new self(self::NO_ACTION);
00038         }
00039         
00043         public static function restrict()
00044         {
00045             return new self(self::RESTRICT);
00046         }
00047         
00051         public static function cascade()
00052         {
00053             return new self(self::CASCADE);
00054         }
00055         
00059         public static function setNull()
00060         {
00061             return new self(self::SET_NULL);
00062         }
00063         
00067         public static function setDefault()
00068         {
00069             return new self(self::SET_DEFAULT);
00070         }
00071     }
00072 ?>

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