FetchFunction
class FetchFunction extends BaseFunction
The fetch function sort of replicates Gryphon's original fetch tag with a number of supercharged changes.
- First, and most obviously, it's not a tag anymore, but a function.
- Second, we can define specific interfaces for each data type, making interacting with them much easier, for example:
{%
set articles = fetch('article')
.wherePublished()
.find()
%}
You can also provide full class names to custom interfaces
{% set bloober = fetch('\\My\\Ns\\Bloober').orderForks().find() %}
Methods
string
getFunctionName()
Return function name
mixed
handle(string $what)
Fetch some dehydrated data.
Details
in BaseFunction at line 9
__construct()
in BaseFunction at line 18
getFunctionOptions()
in BaseFunction at line 23
getDI()
at line 33
string
getFunctionName()
Return function name
at line 48
mixed
handle(string $what)
Fetch some dehydrated data.
{{ fetch('container').findFirstById(1) }}