- Added a MssqlRepository
- Adapter some code to allow more flexibility for the new LDAP adapter from ulmus-ldap. - Insert's fields are now escaped by default. - A new RelationBuilder was added, a lot of code from the EntityTrait was moved into this. Some code from the Repository class will need to be moved there too.
This commit is contained in:
1 parent
8f9332fbad
commit
16c6eb57fb
32 files changed
+641
-243
No files matched your search
@@ -2,13 +2,15 @@
|
||||
|
||||
namespace Ulmus;
|
||||
|
||||
class QueryBuilder
|
||||
use Ulmus\Query\QueryBuilderInterface;
|
||||
|
||||
class QueryBuilder implements Query\QueryBuilderInterface
|
||||
{
|
||||
public Query\Where $where;
|
||||
|
||||
public Query\Having $having;
|
||||
|
||||
public QueryBuilder $parent;
|
||||
public QueryBuilderInterface $parent;
|
||||
|
||||
/**
|
||||
* Those are the parameters we are going to bind to PDO.
|
||||
@@ -371,7 +373,7 @@ class QueryBuilder
|
||||
return array_shift($this->queryStack);
|
||||
}
|
||||
|
||||
public function render(bool $skipToken = false) : string
|
||||
public function render(bool $skipToken = false) /* : mixed */
|
||||
{
|
||||
$sql = [];
|
||||
|
||||
@@ -396,11 +398,13 @@ class QueryBuilder
|
||||
unset($this->where, $this->having);
|
||||
}
|
||||
|
||||
public function getFragment(string $class) : ? Query\Fragment
|
||||
public function getFragment(string $class, int $index = 0) : ? Query\Fragment
|
||||
{
|
||||
foreach($this->queryStack as $item) {
|
||||
if ( get_class($item) === $class ) {
|
||||
return $item;
|
||||
if ( $index-- === 0 ) {
|
||||
return $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user