Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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