- WIP on JsonConditionTrait for SQL flavors that supports it; fixed a bug within Entity initialization from a new method to instanciate it which was implemented

This commit is contained in:
mcndave committed 2024-11-16 16:05:26 +00:00
1 parent 4ad44f73d7
commit e3314f40ac
2 files changed
+50

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
<?php
namespace Ulmus\Repository;
use Ulmus\Query;
trait JsonConditionTrait
{
public function whereJsonArray(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL, $condition = Query\Where::CONDITION_AND) : self
{
if ( null === $this->queryBuilder->getFragment(Query\From::class) ) {
$this->from($this->entityResolver->tableName(), $this->alias, $this->entityResolver->schemaName());
}
$this->queryBuilder->whereJsonArray($field, $value, $operator, $condition);
return $this;
}
}