Skip to content

Commit

Permalink
v4 v.s. v5 method name
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Mar 22, 2024
1 parent 2b16314 commit e10c68f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions stubs/compiled_classes/FactoryFields.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ namespace markhuot\craftpest\storage;
/**
{% for field in fields %}
* @method $this {{ field.handle }}({{ field.factoryTypeHint|default('mixed $value') }}): {{ field.valueType|default(field.phpType)|default('mixed') }} Sets the {{ field.name }} custom field
{% 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 field.valueType|default(field.phpType)|default('mixed') %}
{% 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(', ') }})
Expand Down

0 comments on commit e10c68f

Please sign in to comment.