An item name is not used in Magento\Framework\Console\CommandList.
If you look into this class, you can see, that only values are used, however array keys are also available.
If you define in your module the same type and with same argument item name:
<type name="Magento\Framework\Console\CommandList">
<arguments>
<argument name="commands" xsi:type="array">
<item name="testbedCommand" xsi:type="object">Your\Module\Command\Testbed</item>
</argument>
</arguments>
</type>
and you module goes after Pulsestorm\TutorialObjectManagerArguments, then as the argument you will get your value:
<argument name="commands" xsi:type="array">
<item name="testbedCommand" xsi:type="object">Your\Module\Command\Testbed</item>
</argument>
After some research here is what I've found.
In Magento 2, you can use the following layout files to handle product type specific pages:
catalog_product_view_type_simple.xml
catalog_product_view_type_configurable.xml
catalog_product_view_type_grouped.xml
catalog_product_view_type_bundle.xml
catalog_product_view_type_virtual.xml
catalog_product_view_type_downloadable.xml
Magento 2 adds this specific handle via the initProductLayout
method of Magento\Catalog\Helper\Product\View
:
$resultPage->addPageLayoutHandles(
['id' => $product->getId(), 'sku' => $urlSafeSku, 'type' => $product->getTypeId()]
);
In that particular case, the addPageLayoutHandles
method adds the three following layout handle:
catalog_product_view_id_productid
catalog_product_view_sku_productsku
Hey! that's a new handle that wasn't present on M1
- and finally
catalog_product_view_type_producttype
Full detail of the addPageLayoutHandles
method:
public function addPageLayoutHandles(array $parameters = [], $defaultHandle = null)
{
$handle = $defaultHandle ? $defaultHandle : $this->getDefaultLayoutHandle();
$pageHandles = [$handle];
foreach ($parameters as $key => $value) {
$pageHandles[] = $handle . '_' . $key . '_' . $value;
}
// Do not sort array going into add page handles. Ensure default layout handle is added first.
return $this->addHandle($pageHandles);
}
On top of that, it will also support your custom product type for instance if you create a product type with the name "test" you can then create a file called catalog_product_view_type_test.xml
to handle specific layouts for this type of products.
Best Answer
You can find the data collection class in Magento 2 by
your root\vendor\magento\framework\Data\Collection.php
The class Implements
Hope this helps.