Overview

Namespaces

  • ModHelper
    • Exceptions

Classes

  • ModHelper\A
  • ModHelper\BitwiseFlag
  • ModHelper\Collection
  • ModHelper\Database
  • ModHelper\Editor
  • ModHelper\Hooks
  • ModHelper\Linktree
  • ModHelper\Menu
  • ModHelper\Nonce
  • ModHelper\Psr4AutoloaderClass
  • ModHelper\Verify

Traits

  • ModHelper\SingletonTrait

Exceptions

  • ModHelper\Exceptions\BadCombinationException
  • ModHelper\Exceptions\MissingDataException
  • ModHelper\Exceptions\ValidationException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace ModHelper;
 4: 
 5: /**
 6:  * This file deals with some database internals.
 7:  *
 8:  * @package ModHelper
 9:  * @since 1.0
10:  */
11: class Database
12: {
13:     /**
14:      * Handler to SMF's database functions.
15:      *
16:      * @example ModHelper\Database::query('', 'SELECT * FROM smf_themes', array());
17:      * @param string $name The name (or key) of the $smcFunc you are calling.
18:      * @param string $arguments This is an array of all arguments passed to the method.
19:      * @return mixed The $smcFunc return value or false if not found.
20:      * @throws BadFunctionCallException
21:      * @since 1.0
22:      * @version 1.1
23:      */
24:     public static function __callStatic($name, $arguments)
25:     {
26:         global $smcFunc;
27:         if (isset($smcFunc[$name = 'db_' . $name])) {
28:             if (!is_callable($smcFunc[$name])) {
29:                 throw new \BadFunctionCallException('Function $smcFunc[' . $name . '] is not callable');
30:             }
31:             return call_user_func_array($smcFunc[$name], $arguments);
32:         }
33: 
34:         return false;
35:     }
36: }
37: 
API documentation generated by ApiGen