PHP 클래스 Ouzo\Db\ModelQueryBuilder

파일 보기 프로젝트 열기: letsdrink/ouzo 1 사용 예제들

공개 메소드들

메소드 설명
__clone ( )
__construct ( Model $model, Db $db = null, $alias = null )
_processResults ( $results )
copy ( )
count ( )
deleteAll ( ) Issues "delete from .
deleteEach ( ) Calls Model::delete method for each matching object
fetch ( ) : Model | array
fetchAll ( ) : Model[] | array[]
fetchIterator ( integer $batchSize = 500 ) : Iterator
getQuery ( )
groupBy ( $groupBy )
innerJoin ( $relationSelector, null $aliases = null, array $on = [] ) : ModelQueryBuilder
join ( $relationSelector, null $aliases = null, string $type = 'LEFT', array $on = [] ) : ModelQueryBuilder
leftJoin ( $relationSelector, null $aliases = null, array $on = [] ) : ModelQueryBuilder
limit ( $limit ) : ModelQueryBuilder
lockForUpdate ( ) : ModelQueryBuilder
offset ( $offset ) : ModelQueryBuilder
options ( array $options )
order ( $columns ) : ModelQueryBuilder
rightJoin ( $relationSelector, null $aliases = null, array $on = [] ) : ModelQueryBuilder
select ( $columns, integer $type = PDO::FETCH_NUM ) : ModelQueryBuilder
selectDistinct ( $columns, integer $type = PDO::FETCH_NUM ) : ModelQueryBuilder
update ( array $attributes ) : integer Runs an update query against a set of models
using ( $relationSelector, null $aliases ) : ModelQueryBuilder
where ( string $where = '', array $values = [] ) : ModelQueryBuilder
with ( $relationSelector ) : ModelQueryBuilder

비공개 메소드들

메소드 설명
_addRelationToFetch ( $relationToFetch )
addJoin ( ModelJoin $modelJoin )
aliasPrefixForSelect ( $alias )
createModelJoins ( $relationSelector, $aliases, $type, $on )
getModelAliasOrTable ( )
isAlreadyAddedToFetch ( RelationToFetch $relationToFetch )
isAlreadyJoined ( ModelJoin $modelJoin )
selectModelColumns ( Model $metaInstance, $alias )

메소드 상세

__clone() 공개 메소드

public __clone ( )

__construct() 공개 메소드

public __construct ( Model $model, Db $db = null, $alias = null )
$model Ouzo\Model
$db Ouzo\Db

_processResults() 공개 메소드

public _processResults ( $results )

copy() 공개 메소드

public copy ( )

count() 공개 메소드

public count ( )

deleteAll() 공개 메소드

.. where ..." sql command. Note that overridden Model::delete is not called.
public deleteAll ( )

deleteEach() 공개 메소드

Calls Model::delete method for each matching object
public deleteEach ( )

fetch() 공개 메소드

public fetch ( ) : Model | array
리턴 Ouzo\Model | array

fetchAll() 공개 메소드

public fetchAll ( ) : Model[] | array[]
리턴 Ouzo\Model[] | array[]

fetchIterator() 공개 메소드

public fetchIterator ( integer $batchSize = 500 ) : Iterator
$batchSize integer
리턴 Iterator

getQuery() 공개 메소드

public getQuery ( )

groupBy() 공개 메소드

public groupBy ( $groupBy )

innerJoin() 공개 메소드

public innerJoin ( $relationSelector, null $aliases = null, array $on = [] ) : ModelQueryBuilder
$relationSelector - Relation object, relation name or nested relations 'rel1->rel2'
$aliases null - alias of the first joined table or array of aliases for nested joins
$on array
리턴 ModelQueryBuilder

join() 공개 메소드

public join ( $relationSelector, null $aliases = null, string $type = 'LEFT', array $on = [] ) : ModelQueryBuilder
$relationSelector - Relation object, relation name or nested relations 'rel1->rel2'
$aliases null - alias of the first joined table or array of aliases for nested joins
$type string - join type, defaults to LEFT
$on array
리턴 ModelQueryBuilder

leftJoin() 공개 메소드

public leftJoin ( $relationSelector, null $aliases = null, array $on = [] ) : ModelQueryBuilder
$relationSelector - Relation object, relation name or nested relations 'rel1->rel2'
$aliases null - alias of the first joined table or array of aliases for nested joins
$on array
리턴 ModelQueryBuilder

limit() 공개 메소드

public limit ( $limit ) : ModelQueryBuilder
$limit
리턴 ModelQueryBuilder

lockForUpdate() 공개 메소드

public lockForUpdate ( ) : ModelQueryBuilder
리턴 ModelQueryBuilder

offset() 공개 메소드

public offset ( $offset ) : ModelQueryBuilder
$offset
리턴 ModelQueryBuilder

options() 공개 메소드

public options ( array $options )
$options array

order() 공개 메소드

public order ( $columns ) : ModelQueryBuilder
$columns
리턴 ModelQueryBuilder

rightJoin() 공개 메소드

public rightJoin ( $relationSelector, null $aliases = null, array $on = [] ) : ModelQueryBuilder
$relationSelector - Relation object, relation name or nested relations 'rel1->rel2'
$aliases null - alias of the first joined table or array of aliases for nested joins
$on array
리턴 ModelQueryBuilder

select() 공개 메소드

public select ( $columns, integer $type = PDO::FETCH_NUM ) : ModelQueryBuilder
$columns
$type integer
리턴 ModelQueryBuilder

selectDistinct() 공개 메소드

public selectDistinct ( $columns, integer $type = PDO::FETCH_NUM ) : ModelQueryBuilder
$columns
$type integer
리턴 ModelQueryBuilder

update() 공개 메소드

Runs an update query against a set of models
public update ( array $attributes ) : integer
$attributes array
리턴 integer

using() 공개 메소드

public using ( $relationSelector, null $aliases ) : ModelQueryBuilder
$relationSelector - Relation object, relation name or nested relations 'rel1->rel2'
$aliases null - alias of the first joined table or array of aliases for nested joins
리턴 ModelQueryBuilder

where() 공개 메소드

public where ( string $where = '', array $values = [] ) : ModelQueryBuilder
$where string
$values array
리턴 ModelQueryBuilder

with() 공개 메소드

public with ( $relationSelector ) : ModelQueryBuilder
$relationSelector - Relation object, relation name or nested relations 'rel1->rel2'
리턴 ModelQueryBuilder