-
Notifications
You must be signed in to change notification settings - Fork 3
/
FactoryFields.twig
31 lines (28 loc) · 1.05 KB
/
FactoryFields.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace markhuot\craftpest\storage;
/**
{% for field in fields %}
{% if attribute(field, 'valueType') is defined %}
{% set type = field.valueType() %}
{% elseif attribute(field, 'phpType') is defined %}
{% set type = field.phpType() %}
{% else %}
{% set type = 'mixed' %}
{% endif %}
* @method $this {{ field.handle }}({{ field.factoryTypeHint|default('mixed $value') }}): {{ type }} Sets the {{ field.name }} custom field
{% endfor %}
*
{% for field in fields %}
{% if 'craft\\elements\\db\\MatrixBlockQuery' in type %}
{% for blockType in field.blockTypes %}
{% if loop.first %}
* @method $this addBlockTo{{ field.handle|ucfirst }}({{ blockType.fieldLayout.getCustomFieldElements()|map(f => f.getField().factoryTypeHint|default('mixed $value'))|join(', ') }})
{% endif %}
* @method $this add{{ blockType.handle|ucfirst }}To{{ field.handle|ucfirst }}({{ blockType.fieldLayout.getCustomFieldElements()|map(f => f.getField().factoryTypeHint|default('mixed $value'))|join(', ') }})
{% endfor %}
{% endif %}
{% endfor %}
*/
class FactoryFields
{
}