Example #1
0
 /**
  * returns given referential action in uppercase if valid, otherwise throws
  * an exception
  *
  * @throws Doctrine_Exception_Exception     if unknown referential action given
  * @param string $action    foreign key referential action
  * @param string            foreign key referential action in uppercase
  */
 public function getForeignKeyReferentialActionSql($action)
 {
     $upper = strtoupper($action);
     switch ($upper) {
         case 'CASCADE':
         case 'SET NULL':
         case 'NO ACTION':
         case 'RESTRICT':
         case 'SET DEFAULT':
             return $upper;
             break;
         default:
             throw DoctrineException::unknownForeignKeyReferentialAction($upper);
     }
 }