- Some more work done to allow more flexibility for other plugins

This commit is contained in:
Dave M. 2021-03-24 13:48:09 +00:00
parent 3905047111
commit 317d62ceaa
5 changed files with 7 additions and 6 deletions

View File

@ -170,9 +170,9 @@ class EntityResolver {
return $table;
}
public function databaseName() : string
public function databaseName() : ? string
{
return $this->tableAnnotation(false)->database ?? $this->databaseAdapter()->adapter()->database;
return $this->tableAnnotation(false)->database ?? $this->databaseAdapter()->adapter()->database ?? null;
}
public function sqlAdapter() : \Ulmus\ConnectionAdapter

View File

@ -41,7 +41,7 @@ class ConnectionAdapter
public function getConfiguration() : array
{
return $this->configuration['connections'][$this->name];
return $this->configuration['connections'][$this->name] ?? [];
}
/**

View File

@ -27,7 +27,7 @@ class Set extends Fragment {
return $this;
}
public function render() : string
public function render() /* : mixed */
{
return $this->renderSegments([
'SET', $this->renderParameterPlaceholders(),

View File

@ -114,7 +114,7 @@ class Where extends Fragment {
}
# whitelisting operators
return in_array(strtoupper($this->operator), [ '=', '!=', '<>', 'LIKE' ]) ? $this->operator : "=";
return in_array(strtoupper($this->operator), [ '=', '!=', '<>', 'LIKE', 'IS', 'IS NOT' ]) ? $this->operator : "=";
}
protected function value()

View File

@ -161,6 +161,7 @@ class Repository
$entity->entityFillFromDataset($dataset);
return $update ? (bool) $update->rowCount() : false;
}
}
@ -612,7 +613,7 @@ class Repository
return Ulmus::datasetQueryBuilder($this->queryBuilder, $this->adapter);
}
public function runQuery() : ? \PDOStatement
public function runQuery() /* : mixed */
{
$this->finalizeQuery();