- Work done on matching some new Ulmus method definitions
This commit is contained in:
parent
551762e1fa
commit
cb1528f34b
@ -6,7 +6,7 @@ trait UserAccountControlTrait
|
|||||||
{
|
{
|
||||||
public function matchAccountControl(UserAccountControlEnum $userAccountControl) : bool
|
public function matchAccountControl(UserAccountControlEnum $userAccountControl) : bool
|
||||||
{
|
{
|
||||||
return ($this->userAccountControl & $userAccountControl->value) === $userAccountControl->value;
|
return (($this->userAccountControl ?? false) & $userAccountControl->value) === $userAccountControl->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isDisabled() : bool
|
public function isDisabled() : bool
|
||||||
|
|||||||
@ -41,7 +41,9 @@ trait EntityTrait {
|
|||||||
#[Ignore]
|
#[Ignore]
|
||||||
public static function field($name, null|string|false $alias = Repository::DEFAULT_ALIAS) : EntityField
|
public static function field($name, null|string|false $alias = Repository::DEFAULT_ALIAS) : EntityField
|
||||||
{
|
{
|
||||||
return new EntityField(static::class, $name, false, Ulmus::resolveEntity(static::class));
|
return new EntityField(
|
||||||
|
name: $name, entityClass: static::class, alias: false, entityResolver: Ulmus::resolveEntity(static::class),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Ignore]
|
#[Ignore]
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class Repository extends \Ulmus\Repository
|
|||||||
|
|
||||||
public array $events = [];
|
public array $events = [];
|
||||||
|
|
||||||
public function __construct(string $entity, string $alias = self::DEFAULT_ALIAS, ConnectionAdapter $adapter = null) {
|
public function __construct(string $entity, string $alias = self::DEFAULT_ALIAS, null|ConnectionAdapter $adapter = null) {
|
||||||
# $this->queryBuilder = new QueryBuilder();
|
# $this->queryBuilder = new QueryBuilder();
|
||||||
parent::__construct($entity, $alias, $adapter);
|
parent::__construct($entity, $alias, $adapter);
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,10 @@ trait ConditionTrait
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wheres(array $fieldValues, string $operator = Query\Where::OPERATOR_EQUAL) : Repository
|
public function wheres(array $fieldValues, string|array $operator = Query\Where::OPERATOR_EQUAL, string|array $condition = Query\Where::CONDITION_AND) : self
|
||||||
{
|
{
|
||||||
foreach($fieldValues as $field => $value) {
|
foreach($fieldValues as $field => $value) {
|
||||||
$this->where($field, $value, $operator);
|
$this->where($field, $value, is_array($operator) ? ( $operator[$field] ?? Query\Where::OPERATOR_EQUAL ) : $operator, is_array($condition) ? ( $condition[$field] ?? Query\Where::CONDITION_AND ) : $condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -127,7 +127,7 @@ trait ConditionTrait
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function likes(array $fieldValues, string $condition = Query\Where::CONDITION_AND) : Repository
|
public function likes(array $fieldValues, string|array $condition = Query\Where::CONDITION_AND) : self
|
||||||
{
|
{
|
||||||
foreach($fieldValues as $field => $value) {
|
foreach($fieldValues as $field => $value) {
|
||||||
$this->like($field, $value);
|
$this->like($field, $value);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user