- WIP on Migration of MsSQL
This commit is contained in:
1 parent
c54de30069
commit
fb4985160a
17 files changed
+252
-175
No files matched your search
@@ -262,9 +262,9 @@ class RelationBuilder
|
||||
|
||||
public function oneToMany(string $name, Relation $relation) : Repository
|
||||
{
|
||||
$baseEntity = $relation->entity ?? $this->resolver->reflectedClass->getProperties()[$name]->getTypes()[0]->type;
|
||||
$relation->entity ??= $this->resolver->reflectedClass->getProperties()[$name]->getTypes()[0]->type;
|
||||
|
||||
$this->repository = $baseEntity::repository();
|
||||
$this->repository = $relation->entity::repository();
|
||||
|
||||
$this->applyWhere();
|
||||
|
||||
@@ -281,7 +281,8 @@ class RelationBuilder
|
||||
}
|
||||
|
||||
if (isset($value)) {
|
||||
$this->repository->where( is_object($relation->foreignKey) ? $relation->foreignKey : $baseEntity::field($relation->foreignKey), $value );
|
||||
#$this->repository->where( is_object($relation->foreignKey) ? $relation->foreignKey : $relation->entity::field($relation->foreignKey), $value );
|
||||
$this->repository->where( $relation->foreignKey($this->repository), $value );
|
||||
}
|
||||
else {
|
||||
$this->repository->where(Sql::raw('TRUE'), Sql::raw('FALSE'));
|
||||
|
||||
Reference in new issue
Block a user