Skip to content

appends in a model are ignored #791

@inalto

Description

@inalto

the $appends array in the model should contains all additional fieds that are available but not on the database. These fields are accessible using the accessors.

The current behavior is that if i have an append, it will try to get it from the sql query, but it shouldn't.

In my opinion if there is a model like

 #[ LodataString(name: 'FullName', source: 'full_name'), 

class User extend Model {

$appends = ['full_name'];

public function getFullNameAttribute {

return $this->first_name ." ". $this->last_name;
}

}

full_name has to be pulled from sql query but only from the accessor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions