选择语言 :

Core_Member
    └ ORM_Member_Data
         └ Module_OOP_ORM_Data

用户基础类

API - Core_Member

继承自父类的方法和变量
author
呼吸二氧化碳 jonwang@myqee.com
category
MyQEE
package
System
subpackage
Core
copyright
Copyright © 2008-2013 myqee.com
license
http://www.myqee.com/license.html

$this->check_password( $password )

检查密码是否正确

参数列表

参数 类型 描述 默认值
$password string $password

$this->_get_password_hash( $password )

获取一个新的密码hash值

参数列表

参数 类型 描述 默认值
$password string $password
返回值
  • string

$this->change_password( $new_password )

修改密码

参数列表

参数 类型 描述 默认值
$new_password string $new_password
返回值
  • array 失败返回false

$this->perm( )

返回用户权限对象

返回值
  • Permission

$this->__construct( $array = null)

ORM数据构造

参数列表

参数 类型 描述 默认值
$array array 构造时设置数据,通过此设置的数据被认为是以数据库字段field为键的数组 null

$this->_renew_orm_config( )

构造对象时清除字段

销毁变量以便可以统一采用__get()方法获取


$this->__sleep( )

支持序列化对象 serialize($this)


$this->__wakeup( )

反序列化 unserialize()


$this->__call( )


$this->__unset( $key )

销毁指定key的值

参数列表

参数 类型 描述 默认值
$key string $key

$this->__isset( )


$this->__get( )


$this->__set( )


$this->set_data( $key , $value , $has_parsed = false)

设置数据

键名是对象的键名,而并非数据库字段的键名,可以批量设置 $has_created=是否已构造好的数据。若已构造好的数据则无需再经过_create_data()方法处理,默认false

 set_data( array('a'=>'1','b'=>2) );

set_data( array('a'=>'1','b'=>2) , null , true ); set_data( 'a , '1' ); set_data( 'a , '1' , true );

参数列表

参数 类型 描述 默认值
$key array/string $key
$value fixed
$has_parsed boolean 是否已构造好的数据,默认false bool false
返回值
  • boolean 是否设置成功

$this->json_encode( )

返回本对象json_encode()结果

返回值
  • string

$this->as_array( )

getArrayCopy别名

注意,此方法将返回以对象键名为key的数组,且不会根据设置格式化数据
若希望获取以数据库字段为key的数据,可使用get_field_data()方法

返回值
  • array

$this->getArrayCopy( )

将对象返回成数据,若数据为对象也会一并转换


$this->id_field_name( )

返回当前对象ID字段名

返回值
  • string

$this->_get_offset_config( $index )

获取指定key的配置

参数列表

参数 类型 描述 默认值
$index string $index
返回值
  • array/null

$this->_get_offset_name_by_field( $field_name )

根据字段名获取所有offset键名

参数列表

参数 类型 描述 默认值
$field_name string $field_name
返回值
  • array

$this->value_increment( $offset , $value = 1)

指定offset递增

通过这个方法改变值后,构造SQL时会是field_name=field_name+1,而不是field_name=2这样,可解决并发问题

参数列表

参数 类型 描述 默认值
$offset string $offset
$value ing $value integer 1
返回值
  • $this

$this->value_decrement( $offset , $value = 1)

指定offset递减

与increment_value相反

参数列表

参数 类型 描述 默认值
$offset string $offset
$value ing $value integer 1
返回值
  • $this

$this->update( )

更新数据

返回值
  • int $status 作用的行数

$this->insert( )

插入数据

返回值
  • array array(插入ID,作用行数)

$this->delete( )

删除对象数据

返回值
  • integer 操作行数

$this->get_field_data( $field_name = null)

获取以数据库字段名为键名的数组数据

会排除掉虚拟数据,此数据可直接用户数据库的update

参数列表

参数 类型 描述 默认值
$field_name $field_name 字段名,如果不传则获取所有filed_data数据 null
返回值
  • array

$this->get_changed_data( )

获取修改的数据

注意,返回的数组的键名是字段的键名,而并不是对象的键名

返回值
  • array

$this->_renew_offset_changed_value( & $data , $offset , $is_all_data = false, $renew_original_field_data = false)

更新指定$offset的修改数据并设置到$data相应的key中

参数列表

参数 类型 描述 默认值
$data string $offset
$offset array $data
$is_all_data boolean 是否取得完整数据 bool false
$renew_original_field_data boolean 是否仅更新原始数据 bool false

$this->get_id_field_name( )

获取ID字段名称


$this->get_original_field_data( $field_name = null)

获取原始字段数据

参数列表

参数 类型 描述 默认值
$field_name string 不传就返回全部 null
返回值
  • fixed

$this->orm( )

获取当前ORM

返回值
  • OOP_ORM_Finder_DB
  • OOP_ORM_Finder_Cache
  • OOP_ORM_Finder_HttpClient

$this->get_group_data( )

获取当前数据的组的所有数据

返回值
  • array

$this->delete_orm_cache( $index )

删除指定OFFSET的ORM的缓存(如果有)

参数列表

参数 类型 描述 默认值
$index string $index
返回值
  • boolean

$this->delete_offset_cache( $index )

删除指定的offset的缓存(如果有)

如果有ORM cache的设置,会自动调用$this->delete_orm_cache()方法

参数列表

参数 类型 描述 默认值
$index string $index
返回值
  • boolean

$this->_clear_changed_value_setting( )

清理修改数据记录,以便再次执行$this->update()方法


$this->_create_data( $index )

创建实例化数据

参数列表

参数 类型 描述 默认值
$index string $key

$this->_remove_id_cache_data( )

清除ID数据缓存

返回值
  • $this

$this->__orm_callback_set_orm_( )

用于给ORM回调设置ORM对象


$this->__orm_callback_ini_data_( $data = null, $is_field_key = false)

用于给ORM回调设置数据

参数列表

参数 类型 描述 默认值
$data array 待设置的数据 null
$is_field_key boolean 待设置的数据的key是否数据库的字段,true是,false则为offset bool false

$this->__orm_callback_ini_result_( )

用于给ORM回调初始化数据


$this->__orm_callback_data_is_change_( )

用于给ORM回调判断是否修改过数据

返回值
  • boolean

OOP_ORM_Data::id_field_cache_data( $class_name , $id )

返回ID查询数据的缓存内容

参数列表

参数 类型 描述 默认值
$class_name string $class_name
$id int/array $id
返回值
  • array