- 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:
mcndave committed 2021-03-01 16:26:06 +00:00
1 parent 8f9332fbad
commit 16c6eb57fb
32 files changed
+641 -243

No files matched your search

+6 -2
View File
@@ -233,7 +233,6 @@ class EntityCollection extends \ArrayObject {
public function fromArray(array $datasets, ? string /*stringable*/ $entityClass = null) : self
{
foreach($datasets as $dataset) {
$this->append( $this->arrayToEntity($dataset, $entityClass) );
}
@@ -247,7 +246,7 @@ class EntityCollection extends \ArrayObject {
throw new \Exception("An entity class name must be provided to be instanciated and populated before insertion into this collection.");
}
$className = $this->entityClass;
$className = $entityClass ?: $this->entityClass;
return ( new $className() )->fromArray($dataset);
}
@@ -318,4 +317,9 @@ class EntityCollection extends \ArrayObject {
{
return $this->replaceWith(array_reverse($this->getArrayCopy()));;
}
public function slice(int $offset, ? int $length = null) : self
{
return new self(array_slice($this->getArrayCopy(), $offset, $length));
}
}