Skip to content

docs: Port "Factory" service page to 7.2#586

Open
promptless-for-oss wants to merge 1 commit into
mautic:7.2from
Promptless:promptless/docs-issue-355-factory-7.2
Open

docs: Port "Factory" service page to 7.2#586
promptless-for-oss wants to merge 1 commit into
mautic:7.2from
Promptless:promptless/docs-issue-355-factory-7.2

Conversation

@promptless-for-oss

Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Ports the legacy "Factory Service" developer-docs page into RST at docs/plugin_services/factory.rst on the 7.2 base branch. Documents that MauticFactory was deprecated in 2.0 and removed in 3.0 (gone in Mautic 7), and directs developers to autowired dependency injection with a constructor example, cross-linking the Model factory page for runtime model resolution.

Trigger Events


Tip: Leave inline comments with @Promptless on suggestion diffs in the Promptless dashboard for targeted refinements 💬


``Mautic\Factory\MauticFactory`` is removed in Mautic 7. It was deprecated in Mautic 2.0 and removed in Mautic 3.0. Use dependency injection instead.

Earlier Mautic versions exposed a single ``MauticFactory`` service - available as ``$this->factory`` in controllers and models - that aggregated many dependencies. Mautic 7 relies on autowired dependency injection, so you inject the specific services you need directly through the constructor:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy source page for this port; it states \Mautic\Factory\MauticFactory was "deprecated as of 2.0 and will be phased out through 2.x release cycles and completely removed in 3.0," and that direct dependency injection should be used instead — the basis for the removal warning and DI guidance on this page.

Source: https://github.com/mautic/developer-documentation/blob/main/source/includes/_plugin_services_factory.md


.. warning::

``Mautic\Factory\MauticFactory`` is removed in Mautic 7. It was deprecated in Mautic 2.0 and removed in Mautic 3.0. Use dependency injection instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirms MauticFactory was fully removed rather than merely deprecated — the 3.0 upgrade guide lists "Removed MauticFactory, should use the service container and proper DI" — verifying the warning that it is gone in Mautic 7 and that DI replaces it.

Source: https://github.com/mautic/mautic/blob/7.x/UPGRADE-3.0.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant