PHP Class Swoole\Record

Author: Tianfeng.Han
Inheritance: extends Swoole\Component\Observer, implements ArrayAccess
Datei anzeigen Open project: matyhtf/swoole_framework Class Usage Examples

Public Properties

Property Type Description
$_currend_key
$_current_id
$_delete
$db Swoole\Database
$primary
$table

Protected Properties

Property Type Description
$_change
$_data
$_original_data
$_save
$_update

Public Methods

Method Description
__construct ( $id, $db, $table, $primary, string $where = '', string $select = '*' )
__destruct ( )
__get ( $property ) : null 获取属性
__set ( $property, $value )
delete ( ) : boolean 删除数据库中的此条记录
exist ( ) : boolean 是否存在
get ( ) : array 获取数据数组
getOriginalData ( ) : null | array 获取原始数据
offsetExists ( $key )
offsetGet ( $key )
offsetSet ( $key, $value )
offsetUnset ( $key )
put ( $data ) : void 将关联数组压入object中,赋值给各个字段
save ( ) : boolean 保存对象数据到数据库 如果是空白的记录,保存则会Insert到数据库 如果是已存在的记录,保持则会update,修改过的值,如果没有任何值被修改,则不执行SQL
update ( )

Method Details

__construct() public method

public __construct ( $id, $db, $table, $primary, string $where = '', string $select = '*' )
$id
$db \Swoole\Database
$table
$primary
$where string
$select string

__destruct() public method

public __destruct ( )

__get() public method

获取属性
public __get ( $property ) : null
$property
return null

__set() public method

public __set ( $property, $value )

delete() public method

删除数据库中的此条记录
public delete ( ) : boolean
return boolean

exist() public method

是否存在
public exist ( ) : boolean
return boolean

get() public method

获取数据数组
public get ( ) : array
return array

getOriginalData() public method

获取原始数据
public getOriginalData ( ) : null | array
return null | array | array

offsetExists() public method

public offsetExists ( $key )

offsetGet() public method

public offsetGet ( $key )

offsetSet() public method

public offsetSet ( $key, $value )

offsetUnset() public method

public offsetUnset ( $key )

put() public method

将关联数组压入object中,赋值给各个字段
public put ( $data ) : void
$data
return void

save() public method

保存对象数据到数据库 如果是空白的记录,保存则会Insert到数据库 如果是已存在的记录,保持则会update,修改过的值,如果没有任何值被修改,则不执行SQL
public save ( ) : boolean
return boolean

update() public method

public update ( )

Property Details

$_change protected_oe property

protected $_change

$_currend_key public_oe property

public $_currend_key

$_current_id public_oe property

public $_current_id

$_data protected_oe property

protected $_data

$_delete public_oe property

public $_delete

$_original_data protected_oe property

protected $_original_data

$_save protected_oe property

protected $_save

$_update protected_oe property

protected $_update

$db public_oe property

public Database,Swoole $db
return Swoole\Database

$primary public_oe property

public $primary

$table public_oe property

public $table