0

I know Magento 2 have store, group, website, stores, groups and websites scopes type.

But my question when Magento use singular form and when it uses plural form.

Under core_config_data table sometimes it saves under website or sometime websites scope. How it decide this ?

core_config_data

1 Answer 1

1

But my question when Magento use singular form and when it uses plural form.

It's actually the otherway around: only the 'connector_configuration' which comes from the dotmailer module that uses website. So it's inconsistency. You are supposed to use websites or even better, when you're in working in PHP-Code use the constant \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITES

Magento will always use the plural when querying the database!

https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/App/Config.php#L61

Prove:

SELECT DISTINCT scope FROM core_config_data will return:

  • default
  • stores
  • website
  • websites

SELECT path FROM core_config_data WHERE scope = 'website' will return:

  • connector_configuration/catalog_sync/catalog_type
  • connector_configuration/catalog_sync/catalog_visibility
  • connector_configuration/transactional_data/order_statuses
4
  • That's different thing. Of course these plural scopes are existed so they must have some meaning and importance. Feb 27, 2020 at 1:54
  • well if you don't believe me, give me the explanation what it's webiste instead of websites Feb 27, 2020 at 8:41
  • It's not about I believe you or not. Here I'm trying to understand when to use website and where websites. If you look this file /vendor/magento/module-catalog/Model/ResourceModel/Product/Option.php line 209. How will you comment it's also inconsistent ? Feb 27, 2020 at 8:52
  • 1
    I get your question and provided further information on what to always use the plural. Feb 27, 2020 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.