选择语言 :

Module_OOP_ORM_Finder_DB
    └ Module_OOP_ORM

ORM 数据库核心类

常量
OOP_ORM_Finder_DB::VERSION string(5) "2.3.1"
OOP_ORM_Finder_DB::PARAM_RETURN_FINDER string(6) "finder"
OOP_ORM_Finder_DB::PARAM_RETURN_SINGLE string(6) "single"
OOP_ORM_Finder_DB::PARAM_RETURN_GROUP string(5) "group"

API - Module_OOP_ORM_Finder_DB

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

$this->__construct( )


$this->database( )

获取数据库名称


$this->tablename( )

获取表名称


$this->find( $sql = null, $use_master = null)

获取数据

参数列表

参数 类型 描述 默认值
$sql string 指定SQL语句,不传则使用QueryBulider构造 null
$use_master boolean 查询是否用主数据库 null
返回值
  • OOP_ORM_Result

$this->_get_id_field_cache_data( & $bulider , & $id_cache_data )

根据$bulider条件解析获取已缓存在PHP的数据

参数列表

参数 类型 描述 默认值
$bulider array $bulider
$id_cache_data array $id_cache_data
返回值
  • boolean 是否需要再次读取

$this->driver( )

返回数据库对象

返回值
  • Database

$this->db( )

返回数据库对象

兼容Model的写法

返回值
  • Database

$this->where( $column , $value = null, $op = '=')

参数列表

参数 类型 描述 默认值
$column mixed Column name or array($column, $alias) or object
$value string Logic operator null
$op mixed Column value string(1) "="
返回值
  • OOP_ORM_Finder_DB

$this->order_by( $column , $direction = 'ASC')

Applies sorting with "ORDER BY ..."

参数列表

参数 类型 描述 默认值
$column mixed Column name or array($column, $alias) or object
$direction string Direction of sorting string(3) "ASC"
返回值
  • Database

$this->offset( $number )

Start returning results after "OFFSET ..."

参数列表

参数 类型 描述 默认值
$number integer Starting result number
返回值
  • OOP_ORM_Finder_DB

$this->limit( $number )

Return up to "LIMIT ..." results

参数列表

参数 类型 描述 默认值
$number integer Maximum results to return
返回值
  • OOP_ORM_Finder_DB

$this->in( $column , $value , $no_in = false)

设置 in

参数列表

参数 类型 描述 默认值
$column string $key
$value array $value
$no_in unknown bool false
返回值
  • Database

$this->insert( $value = null)

插入数据

参数列表

参数 类型 描述 默认值
$value string $table null
返回值

$this->update( $value = null, $where = null)

更新数据

参数列表

参数 类型 描述 默认值
$value string $table null
$where array $value null
返回值
  • int 作用的行数

$this->delete( $where = null)

删除数据

参数列表

参数 类型 描述 默认值
$where string $table null
返回值
  • int 作用的行数

$this->get_orm_name( $type )

获取对象名称

参数列表

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

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

创建一条数据 $is_field_key 是所传进来的数据的key是对象的键名还是字段的键名,true=字段的键名,false=对象的键名 差别在于: 由于ORM DATA的键名可以和数据库的字段名称不一样,所以在设置数据的时候需要指定是哪个数据,如果键名和数据库的字段名完全一样,这样的话则没有区别

参数列表

参数 类型 描述 默认值
$data array 数据 null
$is_field_key boolean 数据的键名是否数据库字段,默认false bool false

$this->create_group_data( $array , $is_field_key = false)

返回ORM数据对象

参数列表

参数 类型 描述 默认值
$array $array
$is_field_key boolean 数据的键名是否数据库字段,默认false bool false
返回值
  • OOP_ORM_Result

$this->set_auto_where( $auto_where )

设置自动添加条件

参数列表

参数 类型 描述 默认值
$auto_where array $auto_where

$this->clear_auto_where( )

清除自动添加条件


$this->id_field_name( )


$this->get_by_id( $id , $use_master = false)

根据ID获取对象

参数列表

参数 类型 描述 默认值
$id $id Int 对象ID
$use_master $use_master Boolean 是否使用主数据 bool false

$this->get_by_ids( $ids , $use_master = false)

根据IDs获取对象

参数列表

参数 类型 描述 默认值
$ids $use_master Boolean 是否使用主数据
$use_master unknown bool false
返回值
  • OOP_ORM_Result

$this->last_query( )

返回最后查询语句

返回值
  • string