- WIP on Dataset and Migration attribute
- Removed unused PdoObject and added a new PdoDebugQueryInterface which is still a hugh WIP
This commit is contained in:
1 parent
47aa384c4b
commit
1c03860fc4
12 files changed
+66
-235
No files matched your search
@@ -11,7 +11,6 @@ use Ulmus\Ulmus;
|
||||
|
||||
class DatasetHandler
|
||||
{
|
||||
|
||||
public function __construct(
|
||||
protected EntityResolver $entityResolver,
|
||||
protected bool $entityStrictFieldsDeclaration = false,
|
||||
@@ -20,6 +19,10 @@ class DatasetHandler
|
||||
public function pull(object $entity, bool $nullable = true) : Generator
|
||||
{
|
||||
foreach($this->entityResolver->fieldList(EntityResolver::KEY_ENTITY_NAME, true) as $key => $field) {
|
||||
if (false === ($this->entityResolver->searchFieldAnnotation($key,[ Field\Dataset::class ])->allowPull ?? true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$attribute = $this->entityResolver->searchFieldAnnotation($key,[ Field::class ]);
|
||||
|
||||
if ( $entity->__isset($key) ) {
|
||||
@@ -28,6 +31,7 @@ class DatasetHandler
|
||||
elseif ( $nullable && $field->allowsNull() ) {
|
||||
yield $attribute->name ?? $key => null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +40,10 @@ class DatasetHandler
|
||||
$unmatched = [];
|
||||
|
||||
foreach($dataset as $key => $value) {
|
||||
if (false === ($this->entityResolver->searchFieldAnnotation($key,[ Field\Dataset::class ])->allowPush ?? true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$field = $this->entityResolver->field(strtolower($key), EntityResolver::KEY_COLUMN_NAME, false) ?? $this->entityResolver->field(strtolower($key), EntityResolver::KEY_LC_ENTITY_NAME, false);
|
||||
|
||||
if ( $field === null ) {
|
||||
|
||||
Reference in new issue
Block a user