- 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

+17 -2
View File
@@ -15,6 +15,8 @@ class EntityResolver {
const KEY_COLUMN_NAME = 02;
const KEY_LC_ENTITY_NAME = 03;
public string $entityClass;
public array $uses;
@@ -64,6 +66,11 @@ class EntityResolver {
}
switch($fieldKey) {
case static::KEY_LC_ENTITY_NAME:
$key = strtolower($item['name']);
break;
case static::KEY_ENTITY_NAME:
$key = $item['name'];
break;
@@ -158,12 +165,12 @@ class EntityResolver {
return $this->tableAnnotation(false)->database ?? $this->databaseAdapter()->adapter()->database;
}
public function databaseAdapter() : \Ulmus\ConnectionAdapter
public function sqlAdapter() : \Ulmus\ConnectionAdapter
{
if ( null !== $table = $this->getAnnotationFromClassname( Table::class ) ) {
if ( $table->adapter ?? null ) {
if ( null === ( $adapter = \Ulmus\Ulmus::$registeredAdapters[$table->adapter] ?? null ) ) {
throw new \Exception("Requested database adapter ( {$table->adapter} ) is not registered.");
throw new \Exception("Requested database adapter `{$table->adapter}` is not registered.");
}
else {
return $adapter;
@@ -174,6 +181,14 @@ class EntityResolver {
return Ulmus::$defaultAdapter;
}
/**
* Alias of sqlAdapter
*/
public function databaseAdapter() : \Ulmus\ConnectionAdapter
{
return $this->sqlAdapter();
}
public function schemaName(bool $required = false) : ? string
{
if ( null === $table = $this->getAnnotationFromClassname( Table::class ) ) {