Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appends in a model are ignored #791

Open
inalto opened this issue Feb 14, 2024 · 0 comments
Open

appends in a model are ignored #791

inalto opened this issue Feb 14, 2024 · 0 comments

Comments

@inalto
Copy link

inalto commented Feb 14, 2024

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.

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

No branches or pull requests

1 participant