Glossary

← Glossary

Ashterix

docs(articles): English translation of From Magento to Symfony

en/articles/magento-to-symfony/basics/glossary.md new file +56 −0

Glossary

The equivalents are approximate: where there is no direct counterpart, the note says what to do instead.

Magento 2 Symfony Note
Module: app/code/Vendor/Module, registration.php, module.xml Namespace in src/; a Bundle only for reuse Applications don't write bundles. Code is organized by domain: src/Faq, src/Checkout.
module.xml config/bundles.php Bundle order rarely matters. Flex adds them for you.
Marketplace extension Bundle via Composer + Flex recipe The recipe creates config in config/packages and variables in .env.
ObjectManager Service Container Compiled into a PHP class in var/cache. You can't fetch services from the container in code, only through the constructor.
di.xml config/services.yaml + attributes Autowiring and autoconfiguration: most classes need no config at all.
alias, #[AsAlias] If there is only one implementation, the alias is created automatically.
virtualType A separate service with its own id Plus named autowiring: LoggerInterface $faqLogger.
arguments, bind, #[Autowire] Scalars, parameters, env, other services.
shared="false" shared: false Services are shared by default, as in Magento.
Generated Factory new for entities; your own factory for services Factories aren't generated. A Doctrine entity is created with new.
Generated Proxy lazy: true, #[Autowire(lazy: true)] Lazy services without a separate class in the code.
Plugin before/after/around Decorator #[AsDecorator] or an event Works at the level of a service and interface, not any method.
Array of objects in di.xml (pool, list) Tags + #[AutowireIterator] / #[AutowireLocator] Implementations register themselves via #[AutoconfigureTag].
setup:di:compile Container compilation, cache:warmup In dev it rebuilds itself when files change.
app/etc/env.php .env, .env.local, environment variables Real environment variables take precedence over files.
app/etc/config.php (modules) config/bundles.php A bundle can be enabled for one environment only: ['dev' => true].
core_config_data, system.xml, ScopeConfig Parameters, %env()%; your own table if needed There are no admin settings with scopes.
Developer / production modes APP_ENV=dev / prod / test + APP_DEBUG Per-environment config: when@prod in YAML.
Area: frontend, adminhtml, webapi_rest Firewall + route prefix There is no separate "area". For CLI it's just a command.
routes.xml + Controller/Index/Index.php #[Route] on a controller method One class can have several actions. You can make an invokable controller per action.
ResultFactory: Page, Json, Redirect Response, JsonResponse, RedirectResponse, $this->json() A controller returns a Response.
RequestInterface::getParam() Request, #[MapQueryParameter], #[MapRequestPayload] Controller arguments are filled in automatically.
UrlInterface::getUrl() UrlGeneratorInterface URLs are generated by route name.
URL rewrites, url_rewrite table Routes with a slug There is no rewrite table. The SEO URL is part of the route.
events.xml + ObserverInterface #[AsEventListener], EventSubscriberInterface Priorities and stopping propagation are supported.
String event name + data array Event class; FQCN as the name Typed data instead of DataObject.
Model + ResourceModel + Collection Entity + EntityManager + Repository Data Mapper instead of Active Record.
Repository + SearchCriteria ServiceEntityRepository + QueryBuilder Queries are written as explicit repository methods.
$model->save() persist() + flush() flush() writes all changes, not a single entity.
_beforeSave / _afterSave Doctrine lifecycle events, #[AsEntityListener] A separate Doctrine event dispatcher.
db_schema.xml + whitelist Mapping attributes + Doctrine Migrations Migrations are imperative and versioned. diff is generated from the mapping.
Schema / Data patches Migrations (schema), Fixtures (test data) Reference data for prod also goes into a migration.
EAV Columns, JSON columns, separate tables There is no equivalent, and you usually don't need one.
ResourceConnection, AdapterInterface Doctrine DBAL Connection For raw SQL and bulk operations.
i18n/*.csv, __() Translation: XLIFF/YAML, TranslatorInterface translation:extract collects the keys.
Validation in a service Validator: #[Assert...] on a DTO, #[MapRequestPayload] Violations are returned to the client as a 422 with a list of errors.
acl.xml, ADMIN_RESOURCE Roles, access_control, Voter, #[IsGranted] A Voter decides access to a specific object.
Customer / admin session Firewall, user provider, authenticator The Security component.
Integration tokens, OAuth access_token authenticator, JWT bundle For example, lexik/jwt-authentication-bundle.
webapi.xml + service contracts Controllers + Serializer or API Platform Details are in API and serialization.
Api/Data interfaces DTOs (readonly classes) #[MapRequestPayload] hydrates a DTO from the request body, Serializer handles the response.
/swagger OpenAPI: API Platform or NelmioApiDocBundle Built from routes, types and attributes.
GraphQL: schema.graphqls + resolvers API Platform GraphQL, overblog/graphql-bundle Separate bundles.
communication.xml + queue_*.xml Messenger: message + handler + routing One DTO class, one handler, one line in messenger.yaml.
crontab.xml Scheduler: #[AsCronTask]; or system cron + a command Scheduler runs through a Messenger worker.
Cache types + tags Cache pools + TagAwareCacheInterface You can have as many pools as you like.
Full Page Cache, Varnish HTTP cache: headers, HttpCache, Varnish + FOSHttpCacheBundle There is no FPC out of the box, there is standard HTTP caching.
Logger via virtualType with handlers Monolog channels in monolog.yaml Autowiring by name: $faqLogger.
Integration tests, @magentoDataFixture KernelTestCase, WebTestCase, Foundry Tests see private services through static::getContainer().
Indexers, mview None; Messenger, Doctrine events, cron You build denormalization explicitly.