Skip to content

Commit

Permalink
Replace !Entity::has() with Entity::isEmpty()
Browse files Browse the repository at this point in the history
- Fix issue where fields with null values triggered errors in buildRules.
- Refer: #63
  • Loading branch information
Ridzuan94 committed Dec 4, 2024
1 parent 7e8ac1a commit d0258cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/Behavior/EnumBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function __call(string $method, array $args): bool
throw new MissingEnumConfigurationException([$alias]);
}

if (!$entity->has($config['field']) && Hash::get($config, 'allowEmpty') === true) {
if ($entity->isEmpty($config['field']) && Hash::get($config, 'allowEmpty') === true) {
return true;
}

Expand Down

0 comments on commit d0258cc

Please sign in to comment.