Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
28157a46
Commit
28157a46
authored
Feb 04, 2016
by
MBoretto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CONTRIBUTING and DB.php
parent
970ae10b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
CONTRIBUTING.md
CONTRIBUTING.md
+12
-0
DB.php
src/DB.php
+14
-1
No files found.
CONTRIBUTING.md
View file @
28157a46
...
...
@@ -28,6 +28,18 @@ Further code convention adopted
-------------------------------
-
Each method and class is documented with a docblock
Example for a function or methods:
```
/**
* Get formatted date
*
* @param string $location
*
* @return string
*/
```
-
Each file is provided with the following header:
```
/*
...
...
src/DB.php
View file @
28157a46
<?php
/*
/*
*
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
...
...
@@ -26,6 +26,9 @@ use Longman\TelegramBot\Exception\TelegramException;
* @link http://www.github.com/akalongman/php-telegram-bot
*/
/**
* Class DB.
*/
class
DB
{
/**
...
...
@@ -62,6 +65,7 @@ class DB
* @param array $credentials Database connection details
* @param Telegram $telegram Telegram object to connect with this object
* @param string $table_prefix Table prefix
*
* @return PDO PDO database object
*/
public
static
function
initialize
(
array
$credentials
,
Telegram
$telegram
,
$table_prefix
=
null
)
...
...
@@ -129,6 +133,7 @@ class DB
* Fetch update(s) from DB
*
* @param int $limit Limit the number of updates to fetch
*
* @return array|bool Fetched data or false if not connected
*/
public
static
function
selectTelegramUpdate
(
$limit
=
null
)
...
...
@@ -161,6 +166,7 @@ class DB
* Fetch message(s) from DB
*
* @param int $limit Limit the number of messages to fetch
*
* @return array|bool Fetched data or false if not connected
*/
public
static
function
selectMessages
(
$limit
=
null
)
...
...
@@ -195,6 +201,7 @@ class DB
* Convert from unix timestamp to timestamp
*
* @param int $time Unix timestamp
*
* @return null|string Timestamp if a time has been passed, else null
*/
protected
static
function
getTimestamp
(
$time
=
null
)
...
...
@@ -214,6 +221,7 @@ class DB
* @param int $message_id
* @param int $inline_query_id
* @param int $chosen_inline_query_id
*
* @return bool|null
*/
public
static
function
insertTelegramUpdate
(
$id
,
$message_id
,
$inline_query_id
,
$chosen_inline_query_id
)
...
...
@@ -257,6 +265,7 @@ class DB
* @param Entities\User $user
* @param string $date
* @param Entities\Chat $chat
*
* @return bool|null
*/
public
static
function
insertUser
(
User
$user
,
$date
,
Chat
$chat
=
null
)
...
...
@@ -322,6 +331,7 @@ class DB
* Insert request into database
*
* @param Entities\Update &$update
*
* @return bool
*/
public
static
function
insertRequest
(
Update
&
$update
)
...
...
@@ -388,6 +398,7 @@ class DB
* @todo No return value at the end. Just return true?
*
* @param Entities\InlineQuery &$inline_query
*
* @return bool
*/
public
static
function
insertInlineQueryRequest
(
InlineQuery
&
$inline_query
)
...
...
@@ -436,6 +447,7 @@ class DB
* Insert Message request in db
*
* @param Entities\Message &$message
*
* @return bool If the insert was successful
*/
public
static
function
insertMessageRequest
(
Message
&
$message
)
...
...
@@ -632,6 +644,7 @@ class DB
* @param bool $select_users
* @param string $date_from
* @param string $date_to
*
* @return array|bool Selected chats or false if invalid arguments
*/
public
static
function
selectChats
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment