/**
  * @param string $sTable
  * @return mixed (string or void) Returns the table if it is correct.
  * @throws \PH7\Framework\Mvc\Model\Engine\Util\Various::launchErr() If the table is not valid.
  */
 public static function getTable($sTable)
 {
     switch ($sTable) {
         case 'Profile':
             $sNewTable = 'Members';
             break;
         case 'Picture':
             $sNewTable = 'Pictures';
             break;
         case 'Video':
             $sNewTable = 'Videos';
             break;
         case 'Blog':
             $sNewTable = 'Blogs';
             break;
         case 'Note':
             $sNewTable = 'Notes';
             break;
         case 'Game':
             $sNewTable = 'Games';
             break;
         default:
             Framework\Mvc\Model\Engine\Util\Various::launchErr($sTable);
     }
     return $sNewTable;
 }
Exemple #2
0
 /**
  * Check table.
  *
  * @param string $sTable
  * @return mixed (string or void) Returns the table if it is correct.
  * @see \PH7\Framework\Mvc\Model\Engine\Util\Various::launchErr()
  * @throws \PH7\Framework\Mvc\Model\Engine\Util\Various::launchErr() If the table is not valid.
  */
 public static function checkTable($sTable)
 {
     $sTable = strtolower($sTable);
     // Case insensitivity
     switch ($sTable) {
         case 'profile':
         case 'picture':
         case 'video':
         case 'blog':
         case 'note':
         case 'game':
             return ucfirst($sTable);
             break;
         default:
             Framework\Mvc\Model\Engine\Util\Various::launchErr($sTable);
     }
 }