public function __construct($databaseName, $tableName, $dirPath)
 {
     $this->databaseName = $databaseName;
     $this->tableName = $tableName;
     $this->dirPath = $dirPath;
     $this->className = $this->getClassName($databaseName, $tableName);
     $this->baseClassName = self::$BASE_CLASS_PREFIX . $this->className;
     $this->baseClassDir = self::$BASE_CLASS_DIR;
     $this->con = \DBConnections::getConnection($this->getDatabaseName());
 }
 public function __construct($option = null)
 {
     $this->con = \DBConnections::getConnection(self::getDatabasename());
     if (is_null($option)) {
         $option = self::OPTION_WITH_TRUNCATE;
     }
     if ($option == self::OPTION_WITHOUT_TRUNCATE) {
         return;
     }
     $this->con->exec('set foreign_key_checks = 0');
     $this->truncate();
     $this->con->exec('set foreign_key_checks = 1');
 }
 protected function setUp()
 {
     $databaseName = strtolower(preg_replace('/^(.+?)[A-Z].*$/', '$1', get_class($this)));
     $this->con = \DBConnections::getConnection($databaseName);
 }
示例#4
0
	<!-- Security Token requirment -->
	<label>Security Token Required <input id="security_token_req_checkbox" name="security_token_req_checkbox" type="checkbox" value="1"  onchange='this.form.submit()' <?php 
echo $APITools->security_token_req_checkbox_selected;
?>
></label>&nbsp;&nbsp;<label>Regenerate Security Token? <input id="security_token_regen_checkbox" name="security_token_regen_checkbox" type="checkbox" value="1" onchange='this.form.submit()' <?php 
echo $APITools->security_token_regen_checkbox_selected;
?>
></label>
	<br><br>

	<!-- Security Token Database Selection -->
	<div>Security Token Database</div>
	<?php 
//create an instance of this class
$apiSecTokenDBConnections = new DBConnections();
//change the "select_list_id" property (the element ID)
$apiSecTokenDBConnections->select_list_id = 'api_sec_token_db_connection_list';
//change the "select_list_label" property (the title which appears if you hover over it)
$apiSecTokenDBConnections->select_list_label = 'Select Database for Security Token';
//change the "select_list_connection_form_value" property (this denotes which connection is shown as selected in the select menu)
$apiSecTokenDBConnections->select_list_connection_form_value = $APITools->api_sec_token_db_connection_list;
//now call this method and echo out the result (should be a select list!)
echo $apiSecTokenDBConnections->db_connection_select_list();
echo $APITools->table_checker_builder('security_tokens', $APITools->api_key_db_connection_list, $APITools->api_sec_token_db_connection_list);
?>

	<br><br>

	<!-- variables list-->
	<?php 
 protected function getConnection($databaseName)
 {
     return \DBConnections::getConnection($databaseName);
 }