PHP Class Xpressengine\Database\DynamicQuery

* Illuminate\Database\Query\Builder 를 extends 하여 기능 추가 * insert, update, delete, select 동작할 때 dynamic, proxy 사용여부에 따라 추가 기능 사용 * proxy 사용할 때 ProxyManager 에 등록된 Proxy 동작 * dynamic 을 사용하지 않으면 Illuminate Builder 직접 사용
Author: XE Developers ([email protected])
Inheritance: extends Illuminate\Database\Query\Builder
Show file Open project: xpressengine/xpressengine Class Usage Examples

Protected Properties

Property Type Description
$connection Xpressengine\Database\VirtualConnectionInterface
$dynamic boolean dynamic query
$dynamicTables array dynamic query 사용하면서 join 된 테이블 정보
$options array ProxyManager 로 전달될 값 dynamic() 메소드를 이용할 경우 options 를 지정할 수 있음
$proxy boolean proxyManager 동작 여부 설정
$schemas array schema() 메소드를 통해 가져온 스키마 데이터
$table string
$targetName string A table 의 이름으로 처리하지 못하는 이유는 게시판 처럼 instanceId 로 처리하는 경우가 있기 때문 DynamicField 의 config targetName attribute value

Public Methods

Method Description
count ( string $columns = '*' ) : array | static[] get list
delete ( mixed $id = null ) : integer Delete a record from the database.
find ( integer $id, array $columns = ['*'] ) : mixed | static Execute a query for a single record by ID.
first ( array $columns = ['*'] ) : mixed | static get first row
get ( array $columns = ['*'] ) : array | static[] get list
getDynamicTables ( ) : array get dynamic join table
getProxyManager ( ) : ProxyManager | null get proxy manager
getQuery ( ) : Builder get illuminate database query builder
hasDynamicTable ( string $table ) : boolean has dynamic join table
insert ( array $args ) : boolean insert data
insertGetId ( array $args, string $sequence = null ) : integer insert data and get id
paginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator Paginate the given query into a simple paginator.
setDynamicTable ( string $table ) set dynamic join table information
setProxyOption ( array $options, boolean $merge = true ) proxy 를 위한 options 설정
simplePaginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page' ) : Illuminate\Contracts\Pagination\LengthAwarePaginator Get a paginator only supporting simple next and previous links.
update ( array $args ) : integer update data
useDynamic ( boolean $use = true ) dynamic filter 처리 유무
useProxy ( boolean $use = true ) 프록시 처리 유무 설정

Private Methods

Method Description
filter ( array $args, array $columns ) : array $args 로 넘어온 데이터와 $columns 를 비교해서 $args 값을 거른다.
schema ( ) : array get table schema

Method Details

count() public method

get list
public count ( string $columns = '*' ) : array | static[]
$columns string get columns list
return array | static[]

delete() public method

Delete a record from the database.
public delete ( mixed $id = null ) : integer
$id mixed ID
return integer

find() public method

Execute a query for a single record by ID.
public find ( integer $id, array $columns = ['*'] ) : mixed | static
$id integer ID
$columns array get columns
return mixed | static

first() public method

get first row
public first ( array $columns = ['*'] ) : mixed | static
$columns array get columns list
return mixed | static

get() public method

get list
public get ( array $columns = ['*'] ) : array | static[]
$columns array get columns list
return array | static[]

getDynamicTables() public method

get dynamic join table
public getDynamicTables ( ) : array
return array

getProxyManager() public method

get proxy manager
public getProxyManager ( ) : ProxyManager | null
return ProxyManager | null

getQuery() public method

get illuminate database query builder
Deprecation:
public getQuery ( ) : Builder
return Illuminate\Database\Query\Builder

hasDynamicTable() public method

has dynamic join table
public hasDynamicTable ( string $table ) : boolean
$table string table name
return boolean

insert() public method

insert data
public insert ( array $args ) : boolean
$args array insert data
return boolean

insertGetId() public method

insert data and get id
public insertGetId ( array $args, string $sequence = null ) : integer
$args array insert data
$sequence string sequence
return integer

paginate() public method

Paginate the given query into a simple paginator.
public paginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
$perPage integer count of list
$columns array get columns
$pageName string page parameter name
$page integer | null page number
return Illuminate\Contracts\Pagination\LengthAwarePaginator

setDynamicTable() public method

set dynamic join table information
public setDynamicTable ( string $table )
$table string table name

setProxyOption() public method

proxy 를 위한 options 설정
public setProxyOption ( array $options, boolean $merge = true )
$options array proxy option
$merge boolean merge options or not

simplePaginate() public method

This is more efficient on larger data-sets, etc.
public simplePaginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page' ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
$perPage integer count of list
$columns array get columns
$pageName string page parameter name
return Illuminate\Contracts\Pagination\LengthAwarePaginator

update() public method

update data
public update ( array $args ) : integer
$args array update data
return integer

useDynamic() public method

dynamic filter 처리 유무
public useDynamic ( boolean $use = true )
$use boolean use dynamic flag

useProxy() public method

프록시 처리 유무 설정
public useProxy ( boolean $use = true )
$use boolean proxy use

Property Details

$connection protected property

protected VirtualConnectionInterface,Xpressengine\Database $connection
return Xpressengine\Database\VirtualConnectionInterface

$dynamic protected property

dynamic query
protected bool $dynamic
return boolean

$dynamicTables protected property

dynamic query 사용하면서 join 된 테이블 정보
protected array $dynamicTables
return array

$options protected property

ProxyManager 로 전달될 값 dynamic() 메소드를 이용할 경우 options 를 지정할 수 있음
protected array $options
return array

$proxy protected property

proxyManager 동작 여부 설정
protected bool $proxy
return boolean

$schemas protected property

schema() 메소드를 통해 가져온 스키마 데이터
protected array $schemas
return array

$table protected property

protected string $table
return string

$targetName protected property

A table 의 이름으로 처리하지 못하는 이유는 게시판 처럼 instanceId 로 처리하는 경우가 있기 때문 DynamicField 의 config targetName attribute value
protected string $targetName
return string