Property | Type | Description | |
---|---|---|---|
$mysql_credentials | array | MySQL credentials | |
$pdo | PD\PDO | PDO object | |
$table_prefix | string | Table prefix | |
$telegram | Telegram class object |
Method | Description | |
---|---|---|
entitiesArrayToJson ( array | null $entities, mixed $default = null ) : mixed | Convert array of Entity items to a JSON array | |
externalInitialize ( PD\PDO $external_pdo_connection, |
External Initialize | |
initialize ( array $credentials, |
Initialize | |
insertCallbackQueryRequest ( |
Insert callback query request into database | |
insertChat ( |
Insert chat | |
insertChosenInlineResultRequest ( |
Insert chosen inline result request into database | |
insertEditedMessageRequest ( |
Insert Edited Message request in db | |
insertInlineQueryRequest ( |
Insert inline query request into database | |
insertMessageRequest ( |
Insert Message request in db | |
insertRequest ( |
Insert request into database | |
insertTelegramUpdate ( integer $id, integer $chat_id, integer $message_id, integer $inline_query_id, integer $chosen_inline_result_id, integer $callback_query_id, integer $edited_message_id ) : boolean | Insert entry to telegram_update table | |
insertUser ( Longman\TelegramBot\Entities\User $user, string $date, |
Insert users and save their connection to chats | |
isDbConnected ( ) : boolean | Check if database connection has been created | |
selectChats ( boolean $select_groups = true, boolean $select_super_groups = true, boolean $select_users = true, string $date_from = null, string $date_to = null, integer $chat_id = null, string $text = null ) : array | boolean | Select Group and/or single Chats | |
selectMessages ( integer $limit = null ) : array | boolean | Fetch message(s) from DB | |
selectTelegramUpdate ( integer $limit = null ) : array | boolean | Fetch update(s) from DB |
Method | Description | |
---|---|---|
defineTables ( ) | Define all the tables with the proper prefix | |
getTimestamp ( integer $time = null ) : string | Convert from unix timestamp to timestamp |
protected static defineTables ( ) |
public static externalInitialize ( PD\PDO $external_pdo_connection, |
||
$external_pdo_connection | PD\PDO | PDO database object |
$telegram | Telegram object to connect with this object | |
$table_prefix | string | Table prefix |
return | PD\PDO | PDO database object |
protected static getTimestamp ( integer $time = null ) : string | ||
$time | integer | Unix timestamp (if null, current timestamp is used) |
return | string |
public static initialize ( array $credentials, |
||
$credentials | array | Database connection details |
$telegram | Telegram object to connect with this object | |
$table_prefix | string | Table prefix |
$encoding | string | Database character encoding |
return | PD\PDO | PDO database object |
public static insertCallbackQueryRequest ( |
||
$callback_query | ||
return | boolean | If the insert was successful |
public static insertChosenInlineResultRequest ( |
||
$chosen_inline_result | ||
return | boolean | If the insert was successful |
public static insertEditedMessageRequest ( |
||
$edited_message | ||
return | boolean | If the insert was successful |
public static insertInlineQueryRequest ( |
||
$inline_query | ||
return | boolean | If the insert was successful |
public static insertMessageRequest ( |
||
$message | ||
return | boolean | If the insert was successful |
public static insertRequest ( |
||
$update | ||
return | boolean |
public static insertTelegramUpdate ( integer $id, integer $chat_id, integer $message_id, integer $inline_query_id, integer $chosen_inline_result_id, integer $callback_query_id, integer $edited_message_id ) : boolean | ||
$id | integer | |
$chat_id | integer | |
$message_id | integer | |
$inline_query_id | integer | |
$chosen_inline_result_id | integer | |
$callback_query_id | integer | |
$edited_message_id | integer | |
return | boolean | If the insert was successful |
public static insertUser ( Longman\TelegramBot\Entities\User $user, string $date, |
||
$user | Longman\TelegramBot\Entities\User | |
$date | string | |
$chat | ||
return | boolean | If the insert was successful |
public static isDbConnected ( ) : boolean | ||
return | boolean |
public static selectChats ( boolean $select_groups = true, boolean $select_super_groups = true, boolean $select_users = true, string $date_from = null, string $date_to = null, integer $chat_id = null, string $text = null ) : array | boolean | ||
$select_groups | boolean | |
$select_super_groups | boolean | |
$select_users | boolean | |
$date_from | string | |
$date_to | string | |
$chat_id | integer | |
$text | string | |
return | array | boolean | (Selected chats or false if invalid arguments) |
protected static array $mysql_credentials | ||
return | array |
protected static string $table_prefix | ||
return | string |