- More work done on Update, Insert and Delete clause
- Added TOP property to select and delete to fit MSSQL limit's term. - Added a new interface allowing object's manipulation on save() and load() queries
This commit is contained in:
1 parent
3dc82b1f0d
commit
2f43fb4559
13 files changed
+169
-58
No files matched your search
@@ -11,11 +11,23 @@ class ObjectInstanciator {
|
||||
if ( isset($this->objectCallbackDefinition[$type]) ) {
|
||||
return $this->objectCallbackDefinition[$type](...$arguments);
|
||||
}
|
||||
elseif ( ($obj = new $type() ) instanceof EntityObjectInterface ) {
|
||||
return $obj->load(...$arguments);
|
||||
}
|
||||
else {
|
||||
return new $type(...$arguments);
|
||||
}
|
||||
}
|
||||
|
||||
public function convert(object $obj)
|
||||
{
|
||||
if ( $obj instanceof EntityObjectInterface ) {
|
||||
return $obj->save();
|
||||
}
|
||||
|
||||
return (string) $obj;
|
||||
}
|
||||
|
||||
public function registerObject(string $type, Callable $callback) : void
|
||||
{
|
||||
$this->objectCallbackDefinition[$type] = $callback;
|
||||
|
||||
Reference in new issue
Block a user