/**
  * Returns the array describing the database schema.
  *
  * If the $table parameter is passed, the method will return the schema for the given table,
  * otherwise - for the whole database.
  *
  * @static
  *
  * @throws APIException if the given table does not exist
  *
  * @param string $table
  *
  * @return array
  */
 public static function getSchema($table = null)
 {
     if (is_null(self::$schema)) {
         self::$schema = (include Z::getRootDir() . '/' . self::SCHEMA_FILE);
     }
     if (is_null($table)) {
         return self::$schema;
     } elseif (isset(self::$schema[$table])) {
         return self::$schema[$table];
     } else {
         self::exception(self::SCHEMA_ERROR, _s('Table "%1$s" does not exist.', $table));
     }
 }