\Chat

Chat object

Controlls participants, chat settings, creates new chats, etc.

Summary

Methods
Properties
Constants
__construct()
get()
Create()
No public properties found
CHAT_TYPE
No protected methods found
$users
$message
N/A
Init()
$data
$id
N/A

Constants

CHAT_TYPE

CHAT_TYPE = array('UNDEFINED_CHAT' => 0, 'PRIVATE_CHAT' => 1, 'MULTI_CHAT' => 2)

Chat types library

Properties

$users

$users : array<mixed,\User>

Type

array<mixed,\User> — Chat participants

$message

$message : \Message

Type

\Message — Last message

$data

$data : array

Type

array — Chat info

$id

$id : integer|boolean

Type

integer|boolean — Chat ID

Methods

__construct()

__construct(array|integer  $q, array  $o = array()) : void

Construct Chat

Creates new Chat object instance (Router)

Parameters

array|integer $q

Query

array $o

Options

  • CREATE_CHAT_MODE - Creates nw chat

Throws

\apiException
  • [401] Access denied
  • [600] Incorrect input data
  • [601] Incorrect chat creation data

get()

get(array  $o = array()) : array

Gets Chat info

Returns stored data in the class

Parameters

array $o

Options

Returns

array —

$r

Create()

Create(array  $q, array  $o = array()) : boolean

Creates new chat

Creates new chat in DB

Parameters

array $q

Creation info

array $o

Options

Throws

\apiException
  • [601] Incorrect creation data

Returns

boolean

Init()

Init(integer  $q, array  $o = array()) 

Generate Chat instance

Gets info about chat

Parameters

integer $q

Chat ID

array $o

Options

Throws

\apiException
  • [401] Access denied
  • [600] Incorrect input data