- Added a closure on key to EntityCollection buildArray method.
- Some bugfixes done.
This commit is contained in:
1 parent
317d62ceaa
commit
1469d167c4
3 files changed
+13
-9
No files matched your search
@@ -238,7 +238,7 @@ class EntityResolver {
|
||||
/**
|
||||
* Transform an annotation into it's object's counterpart
|
||||
*/
|
||||
public function getAnnotationFromClassname(string $className) : ? object
|
||||
public function getAnnotationFromClassname(string $className, bool $throwError = true) : ? object
|
||||
{
|
||||
if ( $name = $this->uses[$className] ?? false ) {
|
||||
|
||||
@@ -264,9 +264,11 @@ class EntityResolver {
|
||||
}
|
||||
}
|
||||
|
||||
throw new \TypeError("Annotation `$className` could not be found within your object `{$this->entityClass}`");
|
||||
if ($throwError) {
|
||||
throw new \TypeError("Annotation `$className` could not be found within your object `{$this->entityClass}`");
|
||||
}
|
||||
}
|
||||
else {
|
||||
elseif ($throwError) {
|
||||
throw new \InvalidArgumentException("Class `$className` was not found within {$this->entityClass} uses statement (or it's children / traits)");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user