Skip to content

[Orm] Uncaught ErrorException if EntityCollection->getById() called with invalid id #178

@avolutions

Description

@avolutions

Describe the bug
If EntityCollection->getById() is called with a not existing id, the following exception is thrown:

Uncaught ErrorException: Undefined array key 0

The method should return null (like getFirst()) instead of throwing an exception.

To Reproduce

  1. Create a model, mapping and EntityCollection
  2. Call EntityCollection->getById() and pass a not existing id

Additional information
AVOLUTIONS version: 0.9.0-alpha
PHP version: 8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions