Override Entry's default Augmentation Method #5076
-
Hi All, Is there any good solution to extend / override the Entry repositories default augmentation logic? We have some custom controller which run queries on Entires. For example:
However the process will takes a very long time (2-3sec!) because of the the augmentation of the I read several times the related documentation, but I didn't find answer. :( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm not sure why it would take 2-3 seconds for that. Perhaps your stache watcher is enabled (in Anyway, it's not the Entry class that would control it, it's each fieldtype. You could just not augment that field, then put the raw value in: $arr = $show->toAugmentedArray(['title', 'slug']);
$arr['thumbnail'] = $show->value('thumbnail'); or since you're only using those few things, just build your own array: $arr = [
'title' => $show->value('title'),
'slug' => $show->slug(),
'thumbnail' => $show->value('thumbnail'),
]; |
Beta Was this translation helpful? Give feedback.
I'm not sure why it would take 2-3 seconds for that. Perhaps your stache watcher is enabled (in
config/statamic/stache.php
), which would improve developer experience at the expense of performance. It's fine to have it enabled in development, but turn it off in production.Anyway, it's not the Entry class that would control it, it's each fieldtype.
You could just not augment that field, then put the raw value in:
or since you're only using those few things, just build your own array: