Fix dependency resolution

This commit is contained in:
Dennis Eichhorn 2020-03-12 18:15:32 +01:00
parent 3b24e6c3d7
commit 686d09a599
2 changed files with 8 additions and 37 deletions

View File

@ -51,14 +51,6 @@ abstract class BuilderAbstract
*/
protected int $type = QueryType::NONE;
/**
* Prefix.
*
* @var string
* @since 1.0.0
*/
protected string $prefix = '';
/**
* Raw.
*
@ -79,22 +71,6 @@ abstract class BuilderAbstract
return $this->connection;
}
/**
* Set table name prefix prefix
*
* @param string $prefix Table name prefix
*
* @return static
*
* @since 1.0.0
*/
public function prefix(string $prefix) : self
{
$this->prefix = $prefix;
return $this;
}
/**
* Escape string value
*
@ -109,18 +85,6 @@ abstract class BuilderAbstract
return $this->connection->con->quote($value);
}
/**
* Get prefix.
*
* @return string
*
* @since 1.0.0
*/
public function getPrefix() : string
{
return $this->prefix;
}
/**
* Get query type.
*

View File

@ -403,6 +403,11 @@ class Builder extends BuilderAbstract
}
}
// add from to existing dependencies
foreach ($this->from as $table => $from) {
$dependencies[$table] = [];
}
$resolved = DependencyResolver::resolve($dependencies);
// cyclomatic dependencies
@ -413,7 +418,9 @@ class Builder extends BuilderAbstract
$temp = $this->joins;
$this->joins = [];
foreach ($resolved as $table) {
$this->joins[$table] = $temp[$table];
if (isset($temp[$table])) {
$this->joins[$table] = $temp[$table];
}
}
}