mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
Fix dependency resolution
This commit is contained in:
parent
3b24e6c3d7
commit
686d09a599
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user