Class: DBData
Source Location: /php/db/DBData.php
Class DBData
Class Overview
|
DB 관련 Data를 다루기 위한 클래스입니다.
$db = DB_('mssql', 'db', true);
// 조건절 select
$data->select(" datetime is not null order by 1", false, array('ab','bc','cde'));
// 조건절 selectPage
$page = 1;
$limitPage = 10;
$data->selectPage(" datetime is not null order by 1", $page, $limitPage, array('ab','bc','cde'));
// count 얻기
$limitPage = 10;
$limitBlock = 10;
$arr = $data->selectCount(" datetime is not null ", $limitPage, $limitBlock);
//$arr['count'] : 전체개수 , $arr['page'] : 페이지 개수, $arr['block'] : 블럭개수
$db->close();
Located in /php/db/DBData.php [line 36]
PObject
|
--Data
|
--DBData
Author(s):
Information Tags:
| Todo: | ActiveRecord 패턴 도입 예정 |
|
Properties
|
Methods
|
Inherited Properties, Constants, and Methods
Method Summary
| bool |
delete() |
현재 인덱스에 있는 데이타 delete 실행 |
| bool |
insert() |
현재 인덱스에 있는 데이타 insert 실행 |
| bool |
update() |
현재 인덱스에 있는 데이타 update 실행 |
Methods
DBData __construct(
[IConnector
$connector = null], [string
$table = null], [string
$where = null], string
$field
)
|
|
생성자
Parameters:
|
IConnector |
$connector: |
연결자 |
|
string |
$table: |
테이블 이름 |
|
string |
$where: |
조건절 |
|
string |
$field: |
field리스트 |
API Tags:
Redefinition of:
- Data::__construct()
- 생성자
Redefined in descendants as:
현재 인덱스에 있는 데이타 delete 실행
API Tags:
| Return: | 쿼리 실행 여부 |
| Access: | public |
현재 데이타 모두 delete 실행
API Tags:
DBData getSubData(
string
$table, string
$field1, string
$field2, [string
$field_list = '']
)
|
|
외부 데이타 들고 오기
Parameters:
|
string |
$table: |
자식 테이블 이름 |
|
string |
$field1: |
자식 필드 |
|
string |
$field2: |
부모 필드 |
|
string |
$field_list: |
얻어올 필드 리스트 |
API Tags:
| Return: | 자식 테이블 DBData객체 |
| Deprecated: | |
| Access: | public |
타입 리스트 얻기
API Tags:
| Return: | 타입 리스트를 배열로 얻어옵니다. |
| Access: | public |
void getTypeString(
$type,
$value, [
$is_null = false]
)
|
|
Parameters:
API Tags:
bool insert(
[array
$omit = array()]
)
|
|
현재 인덱스에 있는 데이타 insert 실행
Parameters:
API Tags:
| Return: | 쿼리 실행 여부 |
| Access: | public |
void insertAll(
[array
$omit = array()]
)
|
|
현재 데이타 모두 insert 실행
Parameters:
API Tags:
DBData select(
[string
$where = ''], [bool
$hasNext = false], [array
$field_list = array()]
)
|
|
검색쿼리
echo $data->select(" a = '1' ", false, array('a', 'b', 'c'));
Parameters:
|
string |
$where: |
조건절 |
|
bool |
$hasNext: |
한칸 전진 여부 |
|
array |
$field_list: |
얻어올 필드 리스트 |
API Tags:
array selectCount(
[string
$where = ''], [int
$pagesize = 10], [int
$blocksize = 10]
)
|
|
검색 갯수 얻어오기
Parameters:
|
string |
$where: |
조건문 |
|
int |
$pagesize: |
한 페이지당 나타낼 레코드 개수 |
|
int |
$blocksize: |
한 블럭당 나타낼 페이지 개수 |
API Tags:
DBData selectPage(
[string
$where = ''], [int
$page = 1], [int
$pagesize = 10], [array
$field_list = array()]
)
|
|
페이징 검색 쿼리
echo $data->selectPage(" a = '1' ", 1, 10, array('a', 'b', 'c'));
Parameters:
|
string |
$where: |
조건절 |
|
int |
$page: |
검색될 페이지 |
|
int |
$pagesize: |
한페이지당 레코드 개수 |
|
array |
$field_list: |
필드 리스트 |
API Tags:
void setTable(
string
$table
)
|
|
테이블 이름 설정
Parameters:
API Tags:
void setTypeList(
array
$arr
)
|
|
타입 리스트를 설정합니다.
$dbdata->setTypeList(array('field1' => 'varchar', .... ));
Parameters:
API Tags:
bool update(
[array
$omit = array()], [bool
$is_update_field = false]
)
|
|
현재 인덱스에 있는 데이타 update 실행
Parameters:
|
array |
$omit: |
제한할 필드 리스트 |
|
bool |
$is_update_field: |
false 제외할 필드, true 적용할 필드 |
API Tags:
| Return: | 쿼리 실행 여부 |
| Access: | public |
void updateAll(
[array
$omit = array()]
)
|
|
현재 데이타 모두 update 실행
Parameters:
API Tags:
DBData __call(
$method, [
$args = array()]
)
|
|
필드 값으로 검색한다.
Parameters:
API Tags:
Redefinition of:
- Data::__call()
- utility 형태 메소드 동적 실행
|
|