Documentation

MyModel
in package

MyModel Model

This model demonstrates the usage of the Model class.

Table of Contents

Properties

$db  : mixed

Methods

__construct()  : mixed
Constructor
save()  : mixed
Save Method

Properties

Methods

__construct()

Constructor

public __construct() : mixed

Initializes the database connection.

save()

Save Method

public save() : mixed

This method creates the 'demo' table if it doesn't exist, inserts a new record with the provided 'demo' value, and returns the inserted 'demo' value.

Tags
throws
Exception

If there's an issue with database queries or if validation fails.

Return values
mixed

The inserted 'demo' value or false on failure.


        
On this page

Search results