Class: Cubrid
Source Location: /php/db/Cubrid.php
Class Cubrid
Inherited Properties, Constants, and Methods
Method Summary
| bool |
drop() |
oid 해당되는 instance 삭제 |
| resource |
execute() |
prepare 된 statement 실행 |
| array |
fetch() |
실행된 select 쿼리에 대해서 fetch 를 통해 한 행(row)을 리턴한다. |
| bool |
free() |
result 메모리 해제 |
| mixed|array |
get() |
oid 특정 속성 가지고 오기 |
| array |
getCollection() |
collection 타입을 배열 형태로 얻어옴 (set, multiset, sequence) |
| array |
gets() |
oid 속성값 배열로 가지고 오기 |
| bool |
loadGLO() |
glo 인스턴스를 원하는 file_name으로 저장 |
| resource|bool |
newGLO() |
새로운 glo 클래스를 만들고 oid 리턴 |
| resource |
prepare() |
바인딩 변수 사용 가능하게 하는 메소드 |
| bool |
puts() |
여러 속성값 동시에 설정 |
| bool |
putSeq() |
seq 특정 영역 변경하기 (update) |
| resource |
query() |
일반 쿼리 실행 |
| bool |
saveGLO() |
glo 인스턴스에 file_name에 있는 데이타로 수정하기 |
Methods
Cubrid __construct(
[
$option = ''], [
$type = 'default']
)
|
|
생성자
Parameters:
API Tags:
Redefinition of:
- DBClient::__construct()
bool addSeq(
string
$attr, mixed
$value, [string
$oid = '']
)
|
|
seq 마지막에 추가
Parameters:
|
string |
$attr: |
속성이름 |
|
mixed |
$value: |
속성값 |
|
string |
$oid: |
oid |
API Tags:
bool addSet(
string
$attr, mixed
$value, [string
$oid = '']
)
|
|
set 타입 속성에 값 추가
Parameters:
|
string |
$attr: |
속성이름 |
|
mixed |
$value: |
속성값 |
|
string |
$oid: |
oid |
API Tags:
bool bind(
[int
$index = 1], mixed
$bind_value, [
$bind_value_type = ''], resource
$stmt, string
3
)
|
|
bind 메소드
Parameters:
|
resource |
$stmt: |
prepare() 결과 resource |
|
int |
$index: |
바인딩될 변수 위치, 기본값 1 |
|
mixed |
$bind_value: |
바인딩될 값 |
|
string |
3: |
bind_vlaue_type 바인딩될 타입, 큐브리드에서 사용되는 타입명을 그대로 사용한다. |
|
|
$bind_value_type: |
|
API Tags:
Redefinition of:
- DBClient::bind()
- prepare된 구문을 바인딩 한다.
commit
cubrid 는 기본적으로 트랜잭션을 시작하기 때문에 insert, update, delete는 필히 commit 을 실행해야 합니다. select 도 commit을 해주면 좋습니다.
API Tags:
Redefinition of:
- DBClient::commit()
- commit
CubridProc createProc(
$str, [
$option = 'proc']
)
|
|
프로시저를 실행할 객체를 얻는다.
Parameters:
API Tags:
| See: | createProc($name) |
| Access: | public |
Redefinition of:
- DBClient::createProc()
- 프로시저를 실행할 객체 리턴 , 하위에서 구현해야합니다.
bool drop(
[string
$oid = '']
)
|
|
oid 해당되는 instance 삭제
실제로는 데이타베이스의 레코드가 삭제가 됩니다.
Parameters:
API Tags:
bool dropSeq(
string
$attr, int
$index, [string
$oid = '']
)
|
|
seq 특정영역 삭제
Parameters:
|
string |
$attr: |
속성이름 |
|
int |
$index: |
sequence index , 처음 위치는 1 |
|
string |
$oid: |
oid |
API Tags:
bool dropSet(
string
$attr, mixed
$value, [string
$oid = '']
)
|
|
set 타입 속성에 값 삭제
Parameters:
|
string |
$attr: |
속성이름 |
|
mixed |
$value: |
속성값 |
|
string |
$oid: |
oid |
API Tags:
에러 메세지 리턴
API Tags:
| Return: | 에러 메세지 |
| Access: | public |
Redefinition of:
- DBClient::error()
- 에러 리턴
resource execute(
[string
$option = ''], string|resource
$query
)
|
|
prepare 된 statement 실행
Parameters:
|
string|resource |
$query: |
실행될 쿼리문이나 prepare로 실행된 결과 resource |
|
string |
$option: |
실행될 쿼리 옵션, oid, async, all |
API Tags:
| Return: | 실행 resource, 실패하면 false |
| Access: | public |
Redefinition of:
- DBClient::execute()
- prepare된 구문을 실행한다.
array fetch(
resource
$result
)
|
|
실행된 select 쿼리에 대해서 fetch 를 통해 한 행(row)을 리턴한다.
리턴되는 값은 array('필드' => 'ㅁㅁㅁ', ...); 형태를 가진다.
Parameters:
|
resource |
$result: |
select 결과로 나온 resource |
API Tags:
| Return: | row 데이타 |
| Access: | public |
Redefinition of:
- DBClient::fetch()
- 레코드 가져오기
bool free(
resource
$result
)
|
|
result 메모리 해제
Parameters:
|
resource |
$result: |
select의 결과인 result |
API Tags:
Redefinition of:
- DBClient::free()
- 메모리 해제
mixed|array get(
string|array
$attr, [string
$oid = '']
)
|
|
oid 특정 속성 가지고 오기
Parameters:
|
string|array |
$attr: |
속성(필드) 이름 |
|
string |
$oid: |
속성(필드) 값을 가지고 있는 oid |
API Tags:
| Return: | oid 속성 값 |
| Access: | public |
array getCollection(
string
$attr, [string
$oid = '']
)
|
|
collection 타입을 배열 형태로 얻어옴 (set, multiset, sequence)
속성이 collection 타입일 때 값을 배열로 얻어옵니다.
Parameters:
|
string |
$attr: |
속성이름 |
|
string |
$oid: |
oid |
API Tags:
int getCollectionSize(
string
$attr, [string
$oid = '']
)
|
|
collection 개수 얻어오기
속성이 collection 타입일 때 개수를 얻어온다.
Parameters:
|
string |
$attr: |
속성이름 |
|
string |
$oid: |
oid |
API Tags:
string getCurrentOID(
resource
$result
)
|
|
현재 oid 얻어오기
Parameters:
|
resource |
$result: |
쿼리 결과문으로 나온 result |
API Tags:
| Return: | result에 검색된 oid |
| Access: | public |
int getFieldCount(
resource
$result
)
|
|
쿼리의 결과로 나온 필드의 개수를 리턴한다.
Parameters:
|
resource |
$result: |
select 결과로 나온 resource |
API Tags:
| Return: | 필드개수 |
| Access: | public |
Redefinition of:
- DBClient::getFieldCount()
- 필드 개수 가지고 오기
array getFieldList(
resource
$result
)
|
|
쿼리의 결과로 나온 필드의 이름 리스트를 배열로 리턴한다.
Parameters:
|
resource |
$result: |
select 결과로 나온 resource |
API Tags:
| Return: | 필드이름 리스트 |
| Access: | public |
Redefinition of:
- DBClient::getFieldList()
- 실행되어진 쿼리에 대해서 필드리스트를 가지고 온다.
string getFieldName(
resource
$result, int
$i
)
|
|
정해진 위치의 필드 이름을 얻어온다.
Parameters:
|
resource |
$result: |
select 결과로 나온 resource |
|
int |
$i: |
필드 위치, 처음은 0 |
API Tags:
| Return: | 필드이름 |
| Access: | public |
Redefinition of:
- DBClient::getFieldName()
- 필드 이름 가지고 오기
string getFieldType(
resource
$result, int
$i
)
|
|
정해진 위치의 필드 타입을 얻어온다.
Parameters:
|
resource |
$result: |
select 결과로 나온 resource |
|
int |
$i: |
필드 위치, 처음은 0 |
API Tags:
| Return: | 필드타입 |
| Access: | public |
Redefinition of:
- DBClient::getFieldType()
- 필드 타입 가지고 오기
array getFieldTypeList(
resource
$result
)
|
|
정해진 위치의 필드타입 리스트을 얻어온다.
Parameters:
|
resource |
$result: |
select 결과로 나온 resource |
API Tags:
| Return: | 필드타입 리스트 |
| Access: | public |
Redefinition of:
- DBClient::getFieldTypeList()
- 실행되어진 쿼리에 대해서 필드의 타입 리스트를 가지고 온다.
string getOID(
[string
$oid = '']
)
|
|
oid 설정 얻어오기
기본적으로 설정된 oid가 없으면 parameter로 들어간 oid를 반환한다.
Parameters:
API Tags:
DBData getOIDData(
string
$attr, [bool
$isOne = false], [string
$oid = '']
)
|
|
동일한 타입의 set, multiset, sequence 의 경우 Data 객체로 얻어온다.
collection 타입중에 사용자정의 클래스(테이블) 형태로 저장되어 있는 것이 있으면 그것에 대한 데이타를 DBData 객체로 반환해줍니다.
Parameters:
|
string |
$attr: |
속성이름 |
|
bool |
$isOne: |
한칸 전진 여부 |
|
string |
$oid: |
oid |
API Tags:
DBData getPageData(
string
$query, [int
$page = 1], [int
$count = 10], [string
$order_type = 'order']
)
|
|
select 쿼리에 대해서 페이징된 DBData를 리턴한다.
Parameters:
|
string |
$query: |
select 쿼리 |
|
int |
$page: |
현재 페이지 |
|
int |
$count: |
페이지당 리스트 개수 |
|
string |
$order_type: |
정렬 형태 , order : order by 로 페이징, group : group by 로 페이징, 없으면 rownum으로 페이징 |
API Tags:
Redefinition of:
- DBClient::getPageData()
- paging 된 DBData 얻어오기
array gets(
[string
$oid = '']
)
|
|
oid 속성값 배열로 가지고 오기
Parameters:
API Tags:
string getTypeString(
string
$type, mixed
$value, [boolean
$is_null = false]
)
|
|
각각의 데이타를 쿼리구문에 맞는 문자열로 표시 해준다.
// '123' 으로 표시
// 123 으로 표시
Parameters:
|
string |
$type: |
타입 이름 |
|
mixed |
$value: |
변환될 값 |
|
boolean |
$is_null: |
널을 체크할 것인지 여부 , true 널체크, false 널 체크 안함 |
API Tags:
Redefinition of:
- DBClient::getTypeString()
- 필드 타입(자료형)별 DB에 입력될 수 있는 문자열 얻어오기
bool insertSeq(
string
$attr, int
$index, mixed
$value, [string
$oid = '']
)
|
|
seq 특정 영역에 넣기
Parameters:
|
string |
$attr: |
속성이름 |
|
int |
$index: |
sequence index , 처음 위치는 1 |
|
mixed |
$value: |
속성값 |
|
string |
$oid: |
oid |
API Tags:
bool isInstance(
[string
$oid = '']
)
|
|
oid 존재 여부 확인
Parameters:
API Tags:
| Return: | oid 존재하면 true, 아니면 false |
| Access: | public |
bool loadGLO(
string
$file_name, [resource
$oid = '']
)
|
|
glo 인스턴스를 원하는 file_name으로 저장
Parameters:
|
string |
$file_name: |
저장될 파일 이름 |
|
resource |
$oid: |
glo 인스턴스 |
API Tags:
resource|bool newGLO(
string
$class_name, string
$file_name
)
|
|
새로운 glo 클래스를 만들고 oid 리턴
Parameters:
|
string |
$class_name: |
생성될 cubrid 클래스 이름 , 일반적으로 glo 를 씁니다. |
|
string |
$file_name: |
저장될 파일 이름 |
API Tags:
resource prepare(
string
$query, [string
$option = '']
)
|
|
바인딩 변수 사용 가능하게 하는 메소드
바인딩될 변수는 ? 로 표시한다. //prepare 기본 사용 예제
$sql = "select * from board where title = ?";
$number = "내용";
$cubrid->bind($stmt, 1, $number);
Parameters:
|
string |
$query: |
실행될 쿼리문 |
|
string |
$option: |
실행될때 oid를 리턴할 것인지 여부 지정 , 'oid' oid리턴 |
API Tags:
Redefinition of:
- DBClient::prepare()
- prepare
bool printGLO(
[resource
$oid = ''], [string
$content_type = '']
)
|
|
glo 인스턴스를 표준출력으로 보냄
// 바이너리 그대로 화면에 출력
// gif 이미지 화면에 출력
Parameters:
|
resource |
$oid: |
glo 인스턴스 |
|
string |
$content_type: |
header로 지정될 content-type 값 |
API Tags:
bool put(
string
$attr, mixed
$value, [string
$oid = '']
)
|
|
oid 속성 변경
Parameters:
|
string |
$attr: |
속성(필드) |
|
mixed |
$value: |
속성값 |
|
string |
$oid: |
oid |
API Tags:
| Return: | 성공 했으면 true, 아니면 false |
| Access: | public |
bool puts(
array
$attr_list, [string
$oid = '']
)
|
|
여러 속성값 동시에 설정
$cubrid->puts(array('aa' => 1, 'bb' => 2, 'cc' => 3), $oid);
Parameters:
|
array |
$attr_list: |
속성리스트 |
|
string |
$oid: |
oid |
API Tags:
bool putSeq(
string
$attr, int
$index, mixed
$value, [string
$oid = '']
)
|
|
seq 특정 영역 변경하기 (update)
Parameters:
|
string |
$attr: |
속성이름 |
|
int |
$index: |
sequence index , 처음 위치는 1 |
|
mixed |
$value: |
변경될 값 |
|
string |
$oid: |
oid |
API Tags:
resource query(
string|resource
$query, [string
$option = '']
)
|
|
일반 쿼리 실행
$cubrid->query("insert into tclass values ('a')");
Parameters:
|
string|resource |
$query: |
실행될 쿼리문이나 prepare로 실행된 결과 resource |
|
string |
$option: |
실행될 쿼리 옵션, oid, async, all |
API Tags:
| Return: | 실행 resource, 실패하면 false |
| Access: | public |
Redefinition of:
- DBClient::query()
- 쿼리 실행하기
bool saveGLO(
string
$file_name, [resource
$oid = '']
)
|
|
glo 인스턴스에 file_name에 있는 데이타로 수정하기
인스턴스 내용을 바꿉니다.
Parameters:
|
string |
$file_name: |
glo로 저장될 파일명 |
|
resource |
$oid: |
glo 인스턴스 |
API Tags:
bool seek(
int
$count, [string
$origin = 'current']
)
|
|
커서 이동
Parameters:
|
int |
$count: |
이동시킬 상대위치 |
|
string |
$origin: |
first, current, last, 기본값은 current |
API Tags:
Redefinition of:
- DBClient::seek()
- result set 이동
void setOID(
string
$oid
)
|
|
oid 설정
Parameters:
API Tags:
bool setReadLock(
[string
$oid = '']
)
|
|
읽기 lock 설정
Parameters:
API Tags:
bool setWriteLock(
[string
$oid = '']
)
|
|
쓰기 lock 설정
Parameters:
API Tags:
|
|