PHP 클래스 LdapTools\Query\LdapQueryBuilder

저자: Chad Sikorra ([email protected])
파일 보기 프로젝트 열기: ldaptools/ldaptools 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$baseAnd The base 'And' operator when the method 'where' or 'andWhere' is used.
$baseOr The base 'Or' operator when the method 'orWhere' is used.
$connection The LDAP connection.
$filterBuilder LdapTools\Query\Builder\FilterBuilder | LdapTools\Query\Builder\ADFilterBuilder
$hydrator LdapTools\Hydrator\OperationHydrator
$operation The operation that will eventually be sent to the LDAP connection.
$orderBy The attributes to order by, if any. They will be in ['attribute' => 'ASC'] form.
$schemaFactory LdapTools\Factory\LdapObjectSchemaFactory

공개 메소드들

메소드 설명
__call ( string $method, array $arguments ) : mixed Determines which function, if any, should be called.
__construct ( LdapTools\Connection\LdapConnectionInterface $connection = null, LdapObjectSchemaFactory $schemaFactory = null )
add ( variadic $operators ) Add an operator object to the query.
addControl ( variadic $controls ) Add LDAP controls to be used for the query.
addOrderBy ( string $attribute, string $direction ) Add an attribute to be ordered for the returned results and set the direction for the ordering.
andWhere ( $whereStatements ) Adds additional operators or equality comparisons to the 'and' statement.
filter ( ) : FilterBuilder | ADFilterBuilder Call this to help build additional query statements in an object-oriented fashion.
from ( mixed $type, null | string $alias = null ) Add object types used to narrow the query. This can either be a string name representing the object type from the schema, such as 'user' or 'group' or you can pass the LdapObjectSchema for the type. If you are using this class without a schema then construct the query manually by just using the "where" and "andWhere" methods.
fromGroups ( string | null $alias = null ) A convenience method to select from group object types.
fromOUs ( string | null $alias = null ) A convenience method to select from OU object types.
fromUsers ( string | null $alias = null ) A convenience method to select from user object types.
getAttributes ( ) : array Get the attributes selected for this query.
getBaseDn ( ) : string Get the base DN for the query.
getLdapFilter ( ) : string Get the LDAP filter formed by this query.
getLdapQuery ( ) : LdapQuery Get the LdapQuery object based on the constructed filter and parameters in this builder.
getPageSize ( ) : integer Get the page size for the query.
getScope ( ) : string Get the scope for the query (ie. subtree, onelevel, base).
getServer ( ) : null | string Get the specific LDAP server that the query should be run on, if any is set.
getSizeLimit ( ) : integer Get the size limit for the amount of results returned from LDAP for the query.
getUsePaging ( ) : boolean Get whether or not paging should be used for the query.
orWhere ( $whereStatements ) Create a logical 'or' from the passed arguments. Either pass a key => value array with attribute names and expected values (which will be compared in terms of equality) or pass arbitrary Operator objects using the 'filter' method shortcuts or some other way.
orderBy ( string $attribute, string $direction ) Set the attribute to order by. This will override anything already explicitly set to be ordered. To order on multiple attributes use 'addOrderBy', which allows the attribute ordering to stack.
select ( string | array $attributes = [] ) Set the attributes to select from the object. Either specify a single attribute as a string or an array of attribute names.
setBaseDn ( string $baseDn ) Sets the base DN for the query.
setPageSize ( integer $pageSize ) Set the page size for the query.
setScope ( string $scope ) Set the scope using the QueryOperation::SCOPE constant.
setScopeBase ( ) Set the scope of the query to only the entry defined by the baseDn.
setScopeOneLevel ( ) Set the scope of the query to search only the entries within the baseDn but none of its children.
setScopeSubTree ( ) Set the scope of the query to search the complete the baseDn and all children.
setServer ( string $server ) Set a specific LDAP server to run the query on.
setSizeLimit ( integer $sizeLimit ) Set the size limit for the amount of results returned from LDAP for the query.
setUsePaging ( boolean $usePaging ) Set whether or not paging should be used for the query.
toLdapFilter ( ) : string Get the LDAP filter formed by this query.
where ( $whereStatements ) Create a logical 'and' from the passed statements. Either pass a key => value array with attribute names and expected values (which will be compared in terms of equality) or pass arbitrary Operator objects using the 'filter' method shortcuts or some other way.

보호된 메소드들

메소드 설명
addBaseAndIfNotExists ( ) Adds a base 'bAnd' operator for the convenience 'where', 'andWhere' methods only if it does not already exist.
addBaseOrIfNotExists ( ) Adds a base 'bOr' operator for the convenience 'orWhere' method only if it does not already exist.
getSchemaFromType ( string | LdapObjectSchema $type ) : LdapObjectSchema

메소드 상세

__call() 공개 메소드

Determines which function, if any, should be called.
public __call ( string $method, array $arguments ) : mixed
$method string
$arguments array
리턴 mixed

__construct() 공개 메소드

public __construct ( LdapTools\Connection\LdapConnectionInterface $connection = null, LdapObjectSchemaFactory $schemaFactory = null )
$connection LdapTools\Connection\LdapConnectionInterface
$schemaFactory LdapTools\Factory\LdapObjectSchemaFactory

add() 공개 메소드

Add an operator object to the query.
public add ( variadic $operators )
$operators variadic

addBaseAndIfNotExists() 보호된 메소드

Adds a base 'bAnd' operator for the convenience 'where', 'andWhere' methods only if it does not already exist.
protected addBaseAndIfNotExists ( )

addBaseOrIfNotExists() 보호된 메소드

Adds a base 'bOr' operator for the convenience 'orWhere' method only if it does not already exist.
protected addBaseOrIfNotExists ( )

addControl() 공개 메소드

Add LDAP controls to be used for the query.
public addControl ( variadic $controls )
$controls variadic

addOrderBy() 공개 메소드

Add an attribute to be ordered for the returned results and set the direction for the ordering.
public addOrderBy ( string $attribute, string $direction )
$attribute string The attribute name
$direction string Either 'ASC' or 'DESC'. Defaults to 'ASC'.

andWhere() 공개 메소드

Adds additional operators or equality comparisons to the 'and' statement.
또한 보기: where
public andWhere ( $whereStatements )
$whereStatements Either a key => value array or an Operator type objects.

filter() 공개 메소드

Call this to help build additional query statements in an object-oriented fashion.
public filter ( ) : FilterBuilder | ADFilterBuilder
리턴 LdapTools\Query\Builder\FilterBuilder | LdapTools\Query\Builder\ADFilterBuilder

from() 공개 메소드

Add object types used to narrow the query. This can either be a string name representing the object type from the schema, such as 'user' or 'group' or you can pass the LdapObjectSchema for the type. If you are using this class without a schema then construct the query manually by just using the "where" and "andWhere" methods.
public from ( mixed $type, null | string $alias = null )
$type mixed The string schema type name or a LdapObjectSchema
$alias null | string The alias name to refer to the type being selected

fromGroups() 공개 메소드

A convenience method to select from group object types.
public fromGroups ( string | null $alias = null )
$alias string | null

fromOUs() 공개 메소드

A convenience method to select from OU object types.
public fromOUs ( string | null $alias = null )
$alias string | null

fromUsers() 공개 메소드

A convenience method to select from user object types.
public fromUsers ( string | null $alias = null )
$alias string | null

getAttributes() 공개 메소드

Get the attributes selected for this query.
public getAttributes ( ) : array
리턴 array

getBaseDn() 공개 메소드

Get the base DN for the query.
public getBaseDn ( ) : string
리턴 string

getLdapFilter() 공개 메소드

Get the LDAP filter formed by this query.
사용 중단: This will be removed in a future version. Use the "toLdapFilter()" method instead.
public getLdapFilter ( ) : string
리턴 string

getLdapQuery() 공개 메소드

Get the LdapQuery object based on the constructed filter and parameters in this builder.
public getLdapQuery ( ) : LdapQuery
리턴 LdapQuery

getPageSize() 공개 메소드

Get the page size for the query.
public getPageSize ( ) : integer
리턴 integer

getSchemaFromType() 보호된 메소드

protected getSchemaFromType ( string | LdapObjectSchema $type ) : LdapObjectSchema
$type string | LdapTools\Schema\LdapObjectSchema
리턴 LdapTools\Schema\LdapObjectSchema

getScope() 공개 메소드

Get the scope for the query (ie. subtree, onelevel, base).
public getScope ( ) : string
리턴 string

getServer() 공개 메소드

Get the specific LDAP server that the query should be run on, if any is set.
public getServer ( ) : null | string
리턴 null | string

getSizeLimit() 공개 메소드

Get the size limit for the amount of results returned from LDAP for the query.
public getSizeLimit ( ) : integer
리턴 integer

getUsePaging() 공개 메소드

Get whether or not paging should be used for the query.
public getUsePaging ( ) : boolean
리턴 boolean

orWhere() 공개 메소드

Create a logical 'or' from the passed arguments. Either pass a key => value array with attribute names and expected values (which will be compared in terms of equality) or pass arbitrary Operator objects using the 'filter' method shortcuts or some other way.
public orWhere ( $whereStatements )
$whereStatements Either a key => value array or an Operator type objects.

orderBy() 공개 메소드

Set the attribute to order by. This will override anything already explicitly set to be ordered. To order on multiple attributes use 'addOrderBy', which allows the attribute ordering to stack.
public orderBy ( string $attribute, string $direction )
$attribute string The attribute name
$direction string Either 'ASC' or 'DESC'. Defaults to 'ASC'.

select() 공개 메소드

Set the attributes to select from the object. Either specify a single attribute as a string or an array of attribute names.
public select ( string | array $attributes = [] )
$attributes string | array

setBaseDn() 공개 메소드

Sets the base DN for the query.
public setBaseDn ( string $baseDn )
$baseDn string

setPageSize() 공개 메소드

Set the page size for the query.
public setPageSize ( integer $pageSize )
$pageSize integer

setScope() 공개 메소드

Set the scope using the QueryOperation::SCOPE constant.
public setScope ( string $scope )
$scope string

setScopeBase() 공개 메소드

Set the scope of the query to only the entry defined by the baseDn.
public setScopeBase ( )

setScopeOneLevel() 공개 메소드

Set the scope of the query to search only the entries within the baseDn but none of its children.
public setScopeOneLevel ( )

setScopeSubTree() 공개 메소드

Set the scope of the query to search the complete the baseDn and all children.
public setScopeSubTree ( )

setServer() 공개 메소드

Set a specific LDAP server to run the query on.
public setServer ( string $server )
$server string

setSizeLimit() 공개 메소드

Set the size limit for the amount of results returned from LDAP for the query.
public setSizeLimit ( integer $sizeLimit )
$sizeLimit integer

setUsePaging() 공개 메소드

Set whether or not paging should be used for the query.
public setUsePaging ( boolean $usePaging )
$usePaging boolean

toLdapFilter() 공개 메소드

Get the LDAP filter formed by this query.
public toLdapFilter ( ) : string
리턴 string

where() 공개 메소드

Create a logical 'and' from the passed statements. Either pass a key => value array with attribute names and expected values (which will be compared in terms of equality) or pass arbitrary Operator objects using the 'filter' method shortcuts or some other way.
public where ( $whereStatements )
$whereStatements Either a key => value array or an Operator type objects.

프로퍼티 상세

$baseAnd 보호되어 있는 프로퍼티

The base 'And' operator when the method 'where' or 'andWhere' is used.
protected $baseAnd

$baseOr 보호되어 있는 프로퍼티

The base 'Or' operator when the method 'orWhere' is used.
protected $baseOr

$connection 보호되어 있는 프로퍼티

The LDAP connection.
protected $connection

$filterBuilder 보호되어 있는 프로퍼티

protected FilterBuilder,LdapTools\Query\Builder|ADFilterBuilder,LdapTools\Query\Builder $filterBuilder
리턴 LdapTools\Query\Builder\FilterBuilder | LdapTools\Query\Builder\ADFilterBuilder

$hydrator 보호되어 있는 프로퍼티

protected OperationHydrator,LdapTools\Hydrator $hydrator
리턴 LdapTools\Hydrator\OperationHydrator

$operation 보호되어 있는 프로퍼티

The operation that will eventually be sent to the LDAP connection.
protected $operation

$orderBy 보호되어 있는 프로퍼티

The attributes to order by, if any. They will be in ['attribute' => 'ASC'] form.
protected $orderBy

$schemaFactory 보호되어 있는 프로퍼티

protected LdapObjectSchemaFactory,LdapTools\Factory $schemaFactory
리턴 LdapTools\Factory\LdapObjectSchemaFactory