PHP Class DbBaseModel

It's not a part of main library, just an example. And it's pretty poor. Please consider use your own implementation.
Inheritance: extends CI_Model
Show file Open project: MUlt1mate/cron-manager

Public Properties

Property Type Description
$primary_key
$table_name

Public Methods

Method Description
__construct ( )
__get ( $name )
__isset ( $name )
__set ( $name, $value )
attributes ( )
delete ( )
findAll ( $condition = [] )
findAllBySql ( $sql, $binds = null )
findByPk ( $value ) : self | false
findOne ( $condition = [] )
getAttribute ( $name )
getAttributes ( )
getError ( $key )
getErrors ( )
isNewRecord ( )
query ( $condition )
save ( )
setAttribute ( $name, $value )
setAttributes ( $set )
setError ( string $key, string $message = '' )

Protected Methods

Method Description
afterDelete ( )
afterSave ( )
beforeDelete ( )
beforeSave ( )
getDb ( )
insert ( )
setIsNewRecord ( $set )
update ( )

Method Details

__construct() public method

public __construct ( )

__get() public method

public __get ( $name )

__isset() public method

public __isset ( $name )

__set() public method

public __set ( $name, $value )

afterDelete() protected method

protected afterDelete ( )

afterSave() protected method

protected afterSave ( )

attributes() public method

public attributes ( )

beforeDelete() protected method

protected beforeDelete ( )

beforeSave() protected method

protected beforeSave ( )

delete() public method

public delete ( )

findAll() public static method

public static findAll ( $condition = [] )

findAllBySql() public static method

public static findAllBySql ( $sql, $binds = null )

findByPk() public static method

public static findByPk ( $value ) : self | false
$value
return self | false

findOne() public static method

public static findOne ( $condition = [] )

getAttribute() public method

public getAttribute ( $name )

getAttributes() public method

public getAttributes ( )

getDb() protected static method

protected static getDb ( )

getError() public method

public getError ( $key )

getErrors() public method

public getErrors ( )

insert() protected method

protected insert ( )

isNewRecord() public method

public isNewRecord ( )

query() public static method

public static query ( $condition )

save() public method

public save ( )

setAttribute() public method

public setAttribute ( $name, $value )

setAttributes() public method

public setAttributes ( $set )

setError() public method

public setError ( string $key, string $message = '' )
$key string
$message string

setIsNewRecord() protected method

protected setIsNewRecord ( $set )

update() protected method

protected update ( )

Property Details

$primary_key public static property

public static $primary_key

$table_name public static property

public static $table_name