Пример #1
0
 /**
  * End point for obtaining structure of user schema
  **/
 protected function user_schema()
 {
     if (!$GLOBALS['oracle_connection']) {
         return array('error' => oci_error());
     }
     if ($this->method == 'POST' || $this->method == 'GET') {
         $res = array();
         $user_schema = array();
         $tables = user_table_get();
         foreach ($tables as $table) {
             $table_name = $table['TABLE_NAME'];
             $table['TABLE_COLS'] = user_table_column_get($table['TABLE_NAME']);
             $table['TABLE_PRIMARY_KEY'] = user_schema_get_table_primary_key($table_name);
             $table['TABLE_FOREIGN_KEY'] = user_schema_get_table_foreign_key($table_name);
             $table['TABLE_TRIGGERS'] = user_schema_get_table_triggers($table_name);
             $user_schema[] = $table;
         }
         $res['USER_SCHEMA'] = $user_schema;
         return $res;
     } else {
         return array('error' => self::REQUEST_NOT_SUPPORTED);
     }
 }
Пример #2
0
/**
* Needs to be converted to OO paradigm.
* Functions starting with user_schema are public methods
* Functions starting with _ are private methods.
**/
function user_schema_get()
{
    $table_array = user_table_get();
}