Skip to content

[BUG]:ORM Model::getRelated not reusing already fetched relations #16409

@rudiservo

Description

@rudiservo

Describe the bug
Model::getRelated() does not reuse already fetched relations that are populated in Model::related and Model::dirtyRelated.
getRelated always fetches fresh relations.
This makes requests slower and the Database heavier, normally there is no advantage by doing this, it only makes the request longer and the probability of a changed row while executing the request to happen, this is already almost impossible with the expected time of a request to be in the milliseconds.

Expected behavior
By default getRelated should reuse the relations in these arrays if not instructed otherwise.
Modell has refresh() to update the current model instance, ResultSet does not have this ability yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    5.0The issues we want to solve in the 5.0 releasebugA bug reportstatus: mediumMedium

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions