- Some work done on correcting LDAP package compatibility

This commit is contained in:
mcndave committed 2021-03-09 15:25:46 +00:00
1 parent 71de0a8ac1
commit e3d0e45a4e
13 files changed
+110 -22

No files matched your search

+9 -2
View File
@@ -48,7 +48,7 @@ class QueryBuilder implements Query\QueryBuilderInterface
}
}
public function select($field) : self
public function select($field, bool $distinct = false) : self
{
if ( null !== ( $select = $this->getFragment(Query\Select::class) ) ) {
$select->add($field);
@@ -59,6 +59,8 @@ class QueryBuilder implements Query\QueryBuilderInterface
$this->push($select);
}
$select->distinct = $distinct;
return $this;
}
@@ -401,7 +403,7 @@ class QueryBuilder implements Query\QueryBuilderInterface
public function getFragment(string $class, int $index = 0) : ? Query\Fragment
{
foreach($this->queryStack as $item) {
if ( get_class($item) === $class ) {
if ( is_a($item, $class, true) ) {
if ( $index-- === 0 ) {
return $item;
}
@@ -419,6 +421,11 @@ class QueryBuilder implements Query\QueryBuilderInterface
}
}
}
public function getFragments() : array
{
return $this->queryStack;
}
public function __toString() : string
{