I'm creating my own EAV entity and one of the attributes of my entity has the type select
so it requires a source model.
But I don't want to create my own class just for this attribute since I already have a virtual type defined for it that I use in the form and grid for a flat entity in the same module.
<virtualType name="SomeTypeNameHere" type="[Namespace]\[Module]\Model\Source\Options">
<arguments>
<argument name="options" xsi:type="array">
<item name="1" xsi:type="array">
<item name="value" xsi:type="number">1</item>
<item name="label" xsi:type="string" translate="true">Label 1</item>
</item>
<item name="2" xsi:type="array">
<item name="value" xsi:type="number">2</item>
<item name="label" xsi:type="string" translate="true">Label 2</item>
</item>
</argument>
</arguments>
</virtualType>
Can I use SomeTypeNameHere
as a source_model
for an attribute ?
I know I can test this, but I'm far from having a functional entity. I'm still in the setup phase (more or less).
If someone already tried this I could use a simple Yes/No answer so I know which direction to take.