|
1
|
{"slug":"/references/settings/hasEntity","title":"hasEntity - Settings Module Reference","frontmatter":{"displayed_sidebar":"settingsReference","slug":"/references/settings/hasEntity","sidebar_label":"hasEntity"},"toc":[{"title":"Example","id":"example","level":2},{"title":"Parameters","id":"hasentity-parameters","level":2},{"title":"Returns","id":"hasentity-returns","level":2}],"blocks":[{"kind":"markdown","html":"This documentation provides a reference to the `hasEntity` method. This belongs to the Settings Module."},{"kind":"note","variant":"note","html":"You should only use this methods when implementing complex customizations. For common cases, check out [available workflows instead](/medusa-workflows-reference)."},{"kind":"markdown","html":"Check if an entity exists by name.\nSupports PascalCase, kebab-case, snake\\_case, and plural forms."},{"kind":"heading","level":2,"text":"Example","id":"example"},{"kind":"markdown","html":"```ts\nconst exists = settingsModuleService.hasEntity(\"product\")\n```"},{"kind":"heading","level":2,"text":"Parameters","id":"hasentity-parameters"},{"kind":"typeList","sectionTitle":"hasEntity","types":[{"name":"name","type":"`string`","description":"The name of the entity to check for.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"kind":"heading","level":2,"text":"Returns","id":"hasentity-returns"},{"kind":"typeList","sectionTitle":"hasEntity","types":[{"name":"boolean","type":"`boolean`","optional":false,"defaultValue":"","description":"Whether an entity with the specified name exists.","expandable":false,"children":[]}]}]} |