PHP Class bubasuma\simplechat\Module

The database must contain at less the following two tables: ~~~ CREATE TABLE user ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, .. .. ); CREATE TABLE message ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, sender_id BIGINT UNSIGNED NOT NULL, receiver_id BIGINT UNSIGNED NOT NULL, text VARCHAR(1000) NOT NULL is_new BOOLEAN DEFAULT 1, is_deleted_by_sender BOOLEAN DEFAULT 0, is_deleted_by_receiver BOOLEAN DEFAULT 0, created_at DATETIME NOT NULL, CONSTRAINT fk_message_sender_id FOREIGN KEY (id) REFERENCES user (id) ON DELETE NO ACTION ON UPDATE CASCADE, CONSTRAINT fk_message_receiver_id FOREIGN KEY (id) REFERENCES user (id) ON DELETE NO ACTION ON UPDATE CASCADE, ); ~~~ The user table stores users, and the message table stores messages
Since: 1.0
Author: Buba Suma ([email protected])
Inheritance: extends yii\base\Module, implements yii\base\BootstrapInterface
Show file Open project: bubasuma/yii2-simplechat Class Usage Examples

Public Properties

Property Type Description
$controllerNamespace
$db the DB connection object or the application component ID of the DB connection.

Public Methods

Method Description
beforeAction ( $action )
bootstrap ( $app )
init ( ) Initializes simplechat module.

Method Details

beforeAction() public method

public beforeAction ( $action )

bootstrap() public method

public bootstrap ( $app )

init() public method

This method will initialize the [[db]] property to make sure it refers to a valid DB connection.
public init ( )

Property Details

$controllerNamespace public property

public $controllerNamespace

$db public property

the DB connection object or the application component ID of the DB connection.
public $db