用PHP的refector 直接从代码产生文档

/**
 * The generic DB access Class, Entry of all DB Access
 * Only PG is supported --  201210
 *
 * @author Anthony
 * 2010-2012 reserved
 */
Class [ <user> class DB ] {
  @@ /webserver/apps/pexcel/modules/database/classes/db.php 10-520

  - Constants [7] {
    Constant [ integer SELECT ] { 1 }
    Constant [ integer INSERT ] { 2 }
    Constant [ integer UPDATE ] { 3 }
    Constant [ integer DELETE ] { 4 }
    Constant [ string T ] { t }
    Constant [ string F ] { f }
    Constant [ string N ] { N/A }
  }

  - Static properties [0] {
  }

  - Static methods [22] {
    /**
	 * Specilize the value;
	 * 'f' as False, 't' as TRUE, 'N/A' as NULL value
	 *
	 * @param String $s, Orignal Value
	 *
	 * @return String, specilized value
	 */
    Method [ <user> static public method specializeValue ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 39 - 52

      - Parameters [1] {
        Parameter #0 [ <required> $s ]
      }
    }

    /**
	 * Insert into table from Array Data, and return column[s], ID is return by default
	 *
	 * @param String $table_name Table Name
	 * @param Array $data Array Data Of key value pairs.
	 * @param String/Array $return_cols Return column[s], 'id' is return by default,Array for multi Column
	 * @param String $db Instance name of DB Connection
	 *
	 * @return Boolean/Resultset  True if success without return column, False if failed, value of column[s] if return_cols presented.
	 */
    Method [ <user> static public method insert_table ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 66 - 97

      - Parameters [4] {
        Parameter #0 [ <required> $table_name ]
        Parameter #1 [ <required> $data ]
        Parameter #2 [ <optional> $return_cols = 'id' ]
        Parameter #3 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Update Table data, and compare with reference data
	 *
	 * @param String $table_name Table Name
	 * @param Integer $id ID of data
	 * @param Array $data Array Data Of key value pairs.
	 * @param Array $refdata Reference data 
	 * @param String $id_name Column name of ID
	 * @param String $db Instance name of DB Connection
	 *
	 * @return Integer Affected Rows,False if failed!
	 */
    Method [ <user> static public method update_data ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 112 - 142

      - Parameters [6] {
        Parameter #0 [ <required> $table_name ]
        Parameter #1 [ <required> $id ]
        Parameter #2 [ <required> $data ]
        Parameter #3 [ <required> $refdata ]
        Parameter #4 [ <optional> $id_name = 'id' ]
        Parameter #5 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Update table with data
	 *
	 * @param String $table_name Table Name
	 * @param Integer $id ID of data
	 * @param Array $data Array Data Of key value pairs.
	 * @param String $id_name Column name of ID
	 * @param String $db Instance name of DB Connection
	 *
	 * @return Integer Affected Rows,False if failed!
	 */
    Method [ <user> static public method update_table ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 155 - 163

      - Parameters [5] {
        Parameter #0 [ <required> $table_name ]
        Parameter #1 [ <required> $id ]
        Parameter #2 [ <required> $data ]
        Parameter #3 [ <optional> $id_name = 'id' ]
        Parameter #4 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * quote key value pair of col => values
	 *
	 * @param Array $data, col=>value pairs
	 * @param String $concat, default '='
	 * @param String Delimiter, default ','
	 * @param String Database instance
	 *
	 * @return String 
	 */
    Method [ <user> static public method quote_assoicate ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 175 - 184

      - Parameters [4] {
        Parameter #0 [ <required> $data ]
        Parameter #1 [ <optional> $concat = '=' ]
        Parameter #2 [ <optional> $delimiter = ',' ]
        Parameter #3 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Quote cols
	 *
	 * @param String $value, The column[s] name
	 * @param String $db, Database Instance Name
	 */
    Method [ <user> static public method quote_column ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 192 - 204

      - Parameters [2] {
        Parameter #0 [ <required> $value ]
        Parameter #1 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Quote the values to escape
	 *
	 * @param Scalar/Array  $value
	 *
	 * @return quote string or array
	 */
    Method [ <user> static public method quote ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 212 - 224

      - Parameters [2] {
        Parameter #0 [ <required> $value ]
        Parameter #1 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Escape string of DB
	 *
	 * @param string $s table name
	 * @param String $db Database instance name
	 *
	 * @return String
	 */
    Method [ <user> static public method escape ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 234 - 236

      - Parameters [2] {
        Parameter #0 [ <required> $s ]
        Parameter #1 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Quote Table name
	 *
	 * @param string $s table name
	 * @param String $db Database instance name
	 * 
	 * @return String
	 */
    Method [ <user> static public method quote_table ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 246 - 248

      - Parameters [2] {
        Parameter #0 [ <required> $s ]
        Parameter #1 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Quote a database identifier, such as a column name. 
	 *
	 *     $column = DB::quote_identifier($column,'default');
	 *
	 * You can also use SQL methods within identifiers.
	 *
	 *     // The value of "column" will be quoted
	 *     $column = DB::quote_identifier('COUNT("column")');
	 *
	 * Objects passed to this function will be converted to strings.
	 * [Database_Query] objects will be compiled and converted to a sub-query.
	 * All other objects will be converted using the `__toString` method.
	 *
	 * @param  mixed $value   any identifier
	 * @param String $db, Database instance
	 * @return  string
	 */
    Method [ <user> static public method quote_identifier ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 268 - 270

      - Parameters [2] {
        Parameter #0 [ <required> $value ]
        Parameter #1 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Get Connection for Database instance
	 *
	 * @param String $db Database Instance name
	 *
	 * @return Connection of Databse
	 */
    Method [ <user> static public method getConnection ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 279 - 281

      - Parameters [1] {
        Parameter #0 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Get Children of current record 
	 *
	 * @param String $table Table name
	 * @param Bollean $returnSql 
	 * @param Integer $pid Parent Id of table record
	 * @param String $idname ID column name 
	 * @param String $pidname Parent ID column name
	 * @param String $db Database Instance name
	 *
	 * @return Records of Children
	 */
    Method [ <user> static public method getChildren ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 296 - 309

      - Parameters [6] {
        Parameter #0 [ <required> $table ]
        Parameter #1 [ <optional> $returnSql = false ]
        Parameter #2 [ <optional> $pid = '0' ]
        Parameter #3 [ <optional> $idname = 'id' ]
        Parameter #4 [ <optional> $pidname = 'pid' ]
        Parameter #5 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Tree query for connect by,traverse all the child records of Data 
	 *
	 * @param String $tableName Tablename
	 * @param Boolean  $returnSql Return SQL String if TURE
	 * @param String $startWith Begin valueof traverse
	 * @param String   $idCol ID Column name
	 * @param String  $pidCol   Parent ID Column name
	 * @param String $orderCol	Order Column  
	 * @param Integer $maxDepth 	Depth of traverse, 
	 * @param Integer $level   Start Level 
	 * @param String $delimiter 	Delimiter of branch 
	 * @param String $db  Database configuration instance
	 *
	 * @return Record/String  Return Record array or String of SQL 
	 */
    Method [ <user> static public method getTree ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 327 - 351

      - Parameters [10] {
        Parameter #0 [ <required> $tableName ]
        Parameter #1 [ <optional> $returnSql = false ]
        Parameter #2 [ <optional> $startWith = '0' ]
        Parameter #3 [ <optional> $idCol = 'id' ]
        Parameter #4 [ <optional> $pidCol = 'pid' ]
        Parameter #5 [ <optional> $orderCol = 'id' ]
        Parameter #6 [ <optional> $maxDepth = 0 ]
        Parameter #7 [ <optional> $level = 0 ]
        Parameter #8 [ <optional> $delimiter = ';' ]
        Parameter #9 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Start transaction
	 *
	 * @param String $db  Instance name of DB
	 *
	 * @return Result set
	 */
    Method [ <user> static public method begin ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 360 - 362

      - Parameters [1] {
        Parameter #0 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Define Savepoint
	 *
	 * @param String $savepoint 
	 *
	 * @param String $db 
	 */
    Method [ <user> static public method savepoint ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 371 - 373

      - Parameters [2] {
        Parameter #0 [ <required> $savepoint ]
        Parameter #1 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Rollback to Savepoint
	 *
	 * @param String $savepoint 
	 *
	 * @param String $db Database Instance name 
	 */
    Method [ <user> static public method rollpoint ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 383 - 385

      - Parameters [2] {
        Parameter #0 [ <required> $savepoint ]
        Parameter #1 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Commit an transaction
	 * @param String DB connection
	 */
    Method [ <user> static public method commit ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 392 - 394

      - Parameters [1] {
        Parameter #0 [ <optional> $db = 'default' ]
      }
    }

    Method [ <user> static public method rollback ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 396 - 398

      - Parameters [1] {
        Parameter #0 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Create a new [Database_Query] of the given type.
	 *
	 *     // Create a new SELECT query
	 *     $query = DB::query(self::SELECT, 'SELECT * FROM users');
	 *
	 *     // Create a new DELETE query
	 *     $query = DB::query(self::DELETE, 'DELETE FROM users WHERE id = 5');
	 *
	 * Specifying the type changes the returned result. When using
	 * `self::SELECT`, a [Database_Query_Result] will be returned.
	 * `self::INSERT` queries will return the insert id and number of rows.
	 * For all other queries, the number of affected rows is returned.
	 *
	 * @param   integer  type: self::SELECT, self::UPDATE, etc
	 * @param   string   SQL statement
	 * @param 	Boolean $as_object Return Result set as Object if true, default FALSE
	 * @param  	Array $params  Query parameters of SQL, default array()
	 * @param 	String $stmt_name The query is Prepared Statement if TRUE, 
	 * 			Execute Prepared Statement when $param is Not NULL
	 * 			Prepare Statement when $param is NULL
	 *
	 * @return  Database_Query
	 */
    Method [ <user> static public method query ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 425 - 428

      - Parameters [5] {
        Parameter #0 [ <required> $type ]
        Parameter #1 [ <optional> $sql = NULL ]
        Parameter #2 [ <optional> $as_object = false ]
        Parameter #3 [ <optional> $params = Array ]
        Parameter #4 [ <optional> $stmt_name = NULL ]
      }
    }

    /**
	 * Gettting paginated page from Orignal SQL
	 *
	 * @param String $sql SQL query
	 * @param UTL Object &$page UTL object of tempalte
	 * @param String $orderBy Order by column, default 'updated desc'
	 * @param String $dataPro Data Property Name, default 'data'
	 * @param String $pagePro Pagnation Frament property Name, default 'pagination'
	 * @param Array $config  Pagination Configuration Array overider
	 * @param String $db Database Instance Name, default 'default'
	 * @param Boolean $as_object Populate Data as Object if TRUE, default TRUE
	 * @param String $_paginClass Class Name of pagination 
	 * @return True if success
	 */
    Method [ <user> static public method getPage ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 445 - 477

      - Parameters [9] {
        Parameter #0 [ <required> $_sql ]
        Parameter #1 [ <required> &$page ]
        Parameter #2 [ <optional> $orderBy = 'updated desc' ]
        Parameter #3 [ <optional> $dataPro = 'data' ]
        Parameter #4 [ <optional> $pagePro = 'pagination' ]
        Parameter #5 [ <optional> $config = NULL ]
        Parameter #6 [ <optional> $db = 'default' ]
        Parameter #7 [ <optional> $as_object = true ]
        Parameter #8 [ <optional> $_paginClass = 'Pagination' ]
      }
    }

    /**
	 * Get All roles of subordinate
	 *
	 * @param Integer $role_id Integer User Role ID
	 * @param Boolean $quote  Quote the SQL if ture, reutrn orignal SQL if false 
	 * @param String $role_table Table of role hierarchy
	 * @param Integer $level Start Level of tree traverse
	 * @param String $db Database Instance name
	 * @return SQL String
	 */
    Method [ <user> static public method getRoleTreeSql ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 490 - 497

      - Parameters [5] {
        Parameter #0 [ <required> $role_id ]
        Parameter #1 [ <required> $quote ]
        Parameter #2 [ <required> $role_table ]
        Parameter #3 [ <optional> $level = 0 ]
        Parameter #4 [ <optional> $db = 'default' ]
      }
    }

    /**
	 * Getting SQL String to query Objects of subordinate and owned objects
	 * Child User Role Tree[CURT]
	 *
	 * @param integer $role_id  Role ID of user
	 * @param integer $user_id  User ID
	 * @param String $role_table Table of Role 
	 * @param Boolean $quote Quote the SQL if ture, reutrn orignal SQL if false
	 * @param String $roleCol Role ID column name  
	 * @param String $ownerCol Owner ID column name
	 * @param String $db Database instance name
	 * @return SQL String
	 */
    Method [ <user> static public method getCURTreeSql ] {
      @@ /webserver/apps/pexcel/modules/database/classes/db.php 512 - 519

      - Parameters [7] {
        Parameter #0 [ <required> $role_id ]
        Parameter #1 [ <required> $user_id ]
        Parameter #2 [ <required> $role_table ]
        Parameter #3 [ <optional> $quote = true ]
        Parameter #4 [ <optional> $roleCol = 'role_id' ]
        Parameter #5 [ <optional> $ownerCol = 'owner_id' ]
        Parameter #6 [ <optional> $db = 'default' ]
      }
    }
  }

  - Properties [0] {
  }

  - Methods [0] {
  }
}

你可能感兴趣的:(用PHP的refector 直接从代码产生文档)