public function updateDefaultValuesForNameAttributes($eavSetup)
    {
        $setup      = $eavSetup->getSetup();
        $connection = $setup->getConnection();
        $table      = $setup->getTable('catalog_eav_attribute');

        $attributeIds = [
            $eavSetup->getAttributeId(\Magento\Catalog\Model\Product::ENTITY, 'name'),
            $eavSetup->getAttributeId(\Magento\Catalog\Model\Category::ENTITY, 'name'),
        ];

        foreach ($attributeIds as $attributeId) {
            $connection->update(
                $table,
                ['is_used_in_spellcheck' => true],
                $connection->quoteInto('attribute_id = ?', $attributeId)
            );
        }
    }
public function updateDefaultValuesForNameAttributes($eavSetup)
    {
        $setup      = $eavSetup->getSetup();
        $connection = $setup->getConnection();
        $table      = $setup->getTable('catalog_eav_attribute');

        $attributeIds = [
            $eavSetup->getAttributeId(\Magento\Catalog\Model\Product::ENTITY, 'name'),
            $eavSetup->getAttributeId(\Magento\Catalog\Model\Category::ENTITY, 'name'),
        ];

        foreach ($attributeIds as $attributeId) {
            $connection->update(
                $table,
                ['is_used_in_spellcheck' => true],
                $connection->quoteInto('attribute_id = ?', $attributeId)
            );
        }
    }
public function updateDefaultValuesForNameAttributes ( $ eavSetup ) { $ setup = $ eavSetup -> getSetup ( ) ; $ connection = $ setup -> getConnection ( ) ; $ table = $ setup -> getTable ( 'catalog_eav_attribute' ) ; $ attributeIds = [ $ eavSetup -> getAttributeId ( \ Magento \ Catalog \ Model \ Product :: ENTITY , 'name' ) , $ eavSetup -> getAttributeId ( \ Magento \ Catalog \ Model \ Category :: ENTITY , 'name' ) , ] ; foreach ( $ attributeIds as $ attributeId ) { $ connection -> update ( $ table , [ 'is_used_in_spellcheck' => true ] , $ connection -> quoteInto ( 'attribute_id = ?' , $ attributeId ) ) ; } }
Update default values for the name field of category and product entities.

@param \Magento\Eav\Setup\EavSetup $eavSetup EAV module Setup

@return void
Update default values for the name field of category and product entities .