mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 14:38:39 +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;
|
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.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user