mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-17 08:29:31 +00:00
Use imports instead of FQNs
This commit is contained in:
parent
f63b6d7207
commit
5629215ce4
179 changed files with 792 additions and 597 deletions
|
|
@ -41,9 +41,9 @@ class EntityConstraint extends AbstractConstraint
|
|||
* @param null $value
|
||||
* @param string $operator
|
||||
*/
|
||||
public function __construct(protected ?\App\Services\Trees\NodesListBuilder $nodesListBuilder, protected string $class, string $property, string $identifier = null, protected $value = null, protected ?string $operator = '')
|
||||
public function __construct(protected ?NodesListBuilder $nodesListBuilder, protected string $class, string $property, string $identifier = null, protected $value = null, protected ?string $operator = '')
|
||||
{
|
||||
if (!$nodesListBuilder instanceof \App\Services\Trees\NodesListBuilder && $this->isStructural()) {
|
||||
if (!$nodesListBuilder instanceof NodesListBuilder && $this->isStructural()) {
|
||||
throw new \InvalidArgumentException('NodesListBuilder must be provided for structural entities');
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ class EntityConstraint extends AbstractConstraint
|
|||
}
|
||||
|
||||
//We need to handle null values differently, as they can not be compared with == or !=
|
||||
if (!$this->value instanceof \App\Entity\Base\AbstractDBElement) {
|
||||
if (!$this->value instanceof AbstractDBElement) {
|
||||
if($this->operator === '=' || $this->operator === 'INCLUDING_CHILDREN') {
|
||||
$queryBuilder->andWhere(sprintf("%s IS NULL", $this->property));
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
namespace App\DataTables\Filters\Constraints\Part;
|
||||
|
||||
use Doctrine\ORM\Query\Expr\Orx;
|
||||
use App\DataTables\Filters\Constraints\AbstractConstraint;
|
||||
use Doctrine\ORM\Query\Expr;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
|
|
@ -88,7 +89,7 @@ class TagsConstraint extends AbstractConstraint
|
|||
/**
|
||||
* Builds an expression to query for a single tag
|
||||
*/
|
||||
protected function getExpressionForTag(QueryBuilder $queryBuilder, string $tag): Expr\Orx
|
||||
protected function getExpressionForTag(QueryBuilder $queryBuilder, string $tag): Orx
|
||||
{
|
||||
$tag_identifier_prefix = uniqid($this->identifier . '_', false);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class LogFilter implements FilterInterface
|
|||
/**
|
||||
* @return IntConstraint|NumberConstraint
|
||||
*/
|
||||
public function getDbId(): \App\DataTables\Filters\Constraints\IntConstraint|\App\DataTables\Filters\Constraints\NumberConstraint
|
||||
public function getDbId(): IntConstraint|NumberConstraint
|
||||
{
|
||||
return $this->dbId;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue