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; protected int $type = QueryType::NONE;
/**
* Prefix.
*
* @var string
* @since 1.0.0
*/
protected string $prefix = '';
/** /**
* Raw. * Raw.
* *
@ -79,22 +71,6 @@ abstract class BuilderAbstract
return $this->connection; 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 * Escape string value
* *
@ -109,18 +85,6 @@ abstract class BuilderAbstract
return $this->connection->con->quote($value); return $this->connection->con->quote($value);
} }
/**
* Get prefix.
*
* @return string
*
* @since 1.0.0
*/
public function getPrefix() : string
{
return $this->prefix;
}
/** /**
* Get query type. * 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); $resolved = DependencyResolver::resolve($dependencies);
// cyclomatic dependencies // cyclomatic dependencies
@ -413,7 +418,9 @@ class Builder extends BuilderAbstract
$temp = $this->joins; $temp = $this->joins;
$this->joins = []; $this->joins = [];
foreach ($resolved as $table) { foreach ($resolved as $table) {
$this->joins[$table] = $temp[$table]; if (isset($temp[$table])) {
$this->joins[$table] = $temp[$table];
}
} }
} }