initialize() public static method

Initialize
public static initialize ( array $credentials, Telegram $telegram, string $table_prefix = null, string $encoding = 'utf8mb4' ) : PD\PDO
$credentials array Database connection details
$telegram Telegram Telegram object to connect with this object
$table_prefix string Table prefix
$encoding string Database character encoding
return PD\PDO PDO database object
Ejemplo n.º 1
0
 /**
  * Initialize Database connection
  *
  * @param array  $credential
  * @param string $table_prefix
  *
  * @return Telegram
  */
 public function enableMySql(array $credential, $table_prefix = null, $encoding = 'utf8mb4')
 {
     $this->pdo = DB::initialize($credential, $this, $table_prefix, $encoding);
     ConversationDB::initializeConversation();
     $this->mysql_enabled = true;
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Initialize
  *
  * @param array credential, string table_prefix
  */
 public function enableMySQL(array $credential, $table_prefix = null)
 {
     $this->pdo = DB::initialize($credential, $table_prefix);
     $this->mysql_enabled = true;
 }