class User_model extends MY_Model { function __construct() { parent::__construct('users'); } }
class User_model extends MY_Model { function __construct() { parent::__construct('users', 'user_id'); } }This example shows how to override the default primary key for the user table to 'user_id'. Here, the User_model extends the MY_Model class and the __construct method is used to set the table name and primary key parameter values. The package library is a PHP library for ORMs and Active Record patterns. As such, it can be used with any PHP-based application, framework or project.