API reference
Every @api type with its members, generated by the doctor.
Mrx\Catalog\Api\ProductKindContextInterface
Interface. The kind of product the product editor shows: a code from the product_kinds pool ("product", or a pack's such as "bundle" or "group_page"). On "Add product" it is the kind the page was opened for (?kind=); on a saved product the kind whose type_ids claim its type. Null on the kind chooser and for a type no kind claims. Bound to the editor's view model in the admin area only, like ProductPageContextInterface, so a card gets the instance the page loaded.
| Kind | Member |
|---|---|
| method | getKind(): ?string |
Mrx\Catalog\Api\ProductPageContextInterface
Interface. Lets a card in the product editor's slots read the product the page shows. It resolves to the page's own view model, so the card sees the same loaded instance without a second load. The slots print only in the default-language view, so a card always gets the store 0 product, or null on "Add product".
| Kind | Member |
|---|---|
| method | getProduct(): ?Magento\Catalog\Api\Data\ProductInterface |
Mrx\Catalog\Api\StockSourceInterface
Interface. Where a product's salable stock is read, per stock: what a pack needs to judge whether its products can be sold and how many. Catalog answers from Magento's own stock item, one stock for every website. Mrx_Locations replaces it with Multi-Source Inventory's salable quantities, so a pack reads stock the same way with or without MSI.
| Kind | Member |
|---|---|
| method | stockIds(array $websiteIds): array |
| method | isSalable(string $sku, int $stockId, float $qty): bool |
| method | salableQty(string $sku, int $stockId): ?float |
| method | sourceCodes(string $sku): array |
Mrx\Customers\Api\CustomerNotesInterface
Interface.
| Kind | Member |
|---|---|
| const | MAX_LENGTH = 5000 |
| const | EMAIL_WELCOME = "email_welcome" |
| const | EMAIL_CONFIRMATION = "email_confirm" |
| const | EMAIL_PASSWORD_RESET = "email_reset" |
| method | getNote(int $customerId): ?array |
| method | saveNote(int $customerId, string $body, ?int $adminUserId): void |
| method | addComment(int $customerId, string $body, ?int $adminUserId): int |
| method | deleteComment(int $customerId, int $commentId): bool |
| method | getComments(int $customerId, int $limit = 100): array |
| method | addMarketingChange(int $customerId, string $status): void |
| method | getMarketingChanges(int $customerId, int $limit = 50): array |
| method | addEmailEvent(int $customerId, string $type, string $recipient, ?int $adminUserId): void |
| method | getEmailEvents(int $customerId, int $limit = 50): array |
Mrx\Customers\Api\CustomerPageContextInterface
Interface. The customer shown on the Light customer page. A card in mrx.customer.main.bottom or mrx.customer.aside.bottom asks for this interface and gets the page's own view model, so it reads the same customer without loading it again.
| Kind | Member |
|---|---|
| method | getCustomer(): ?Magento\Customer\Api\Data\CustomerInterface |
Mrx\Customers\Api\GroupAssignmentInterface
Interface. Puts a customer in a group a person chose, from a screen that is not the customer page (an account request that gets approved). With the "Business customers in other EU countries" switch on, the group is kept against Magento's VAT number check, the way a group picked on the contact card is.
| Kind | Member |
|---|---|
| method | getOptions(): array |
| method | getLabel(int $groupId): string |
| method | keepsGroupByHand(): bool |
| method | assign(int $customerId, int $groupId): Magento\Customer\Api\Data\CustomerInterface |
Mrx\Customers\Api\TimelineProviderInterface
Interface. Adds computed events to the customer timeline. Register it in etc/adminhtml/di.xml, Mrx\Customers\Model\Timeline argument "providers". Mark it #[RequiresModule(...)] when it belongs to an extension that can be switched off, and register it as its \Proxy when its constructor needs that extension's classes. The customer arrives as the argument: do not inject CustomerPageContextInterface here or in services this provider builds.
| Kind | Member |
|---|---|
| method | getEvents(Magento\Customer\Api\Data\CustomerInterface $customer): array |
Mrx\Documents\Api\Data\Document
Class.
| Kind | Member |
|---|---|
| property | $storeId: int readonly |
| property | $title: string readonly |
| property | $number: string readonly |
| property | $date: string readonly |
| property | $data: array readonly |
| method | __construct(int $storeId, string $title, string $number, string $date, array $data) |
Mrx\Documents\Api\DocumentRendererInterface
Interface. Prints documents of one type from the "documents" pool as one PDF, each in its own store view's language and the owner's format.
| Kind | Member |
|---|---|
| method | render(string $type, array $ids): string |
| method | renderDocuments(string $type, array $documents): string |
Mrx\Documents\Api\DocumentSectionInterface
Interface. A block added to documents of other modules, registered in the "document_sections" pool of Mrx\Documents\Model\Pdf\Sections as {section: object, document: type code or "", position: after_parties, after_items or after_totals, sort_order?, module?}. It renders in the frontend area of the document's store view. "" includes staff documents such as the picklist, whose number is the moment it was printed and whose language is the admin's; a section meant for customers names its types.
| Kind | Member |
|---|---|
| method | render(Mrx\Documents\Api\Data\Document $document, Magento\Framework\View\LayoutInterface $layout): string |
Mrx\Documents\Api\DocumentTypeInterface
Interface. A PDF document type in the "documents" pool of Mrx\Documents\Model\Pdf\DocumentTypes. The type writes only the body: its template fills the doc-parties, doc-items, doc-totals and doc-note blocks, and Light adds the letterhead, footer and page numbers in the owner's format.
| Kind | Member |
|---|---|
| method | getLabel(): string |
| method | getAclResource(): string |
| method | getTemplate(): string |
| method | getData(array $ids): array |
| method | getFilename(array $ids): string |
Mrx\Documents\Api\DocumentsChoiceInterface
Interface. Whether the shop sends Light's emails and PDFs or keeps what it sent before Light. The merchant chooses once per shop, at default scope, on Settings > Emails & documents; installing Light never switches it. A module that renders or sends a customer document asks here before it replaces Magento's.
| Kind | Member |
|---|---|
| method | usesLightEmails(): bool |
| method | usesLightPdfs(): bool |
| method | isConfirmed(): bool |
| method | pdfsSince(): ?string |
| method | asLight(callable $fn): mixed |
Mrx\Documents\Api\ItemLineInterface
Interface. Turns one item of an invoice, credit memo, shipment or order into the rows a PDF table shows. Registered in the "item_lines" pool of Mrx\Documents\Model\Pdf\ItemLines, keyed by product type; "default" serves every type without its own line.
| Kind | Member |
|---|---|
| method | getLines(Magento\Framework\DataObject $item): array |
Mrx\Documents\Api\PdfRendererInterface
Interface. Turns one HTML document into PDF bytes. Light's default uses dompdf; a shop that runs Gotenberg or mPDF can set a preference. The HTML holds its own CSS; fonts are declared with @font-face and file:// URLs.
| Kind | Member |
|---|---|
| method | render(string $html, array $options = []): string |
Mrx\Documents\Api\PickLocationInterface
Interface. Where products are stored, for the picklist's Bin column and sort. Registered in the "pick_locations" pool of Mrx\Documents\Model\Pdf\PickLocations; later items win for a SKU both know.
| Kind | Member |
|---|---|
| method | getLocations(array $skus, int $storeId): array |
Mrx\Home\Api\ChannelAwareCounterInterface
Interface. A "Things to do" counter that can narrow its count to the channel Home is filtered on. Counters that only implement CounterInterface count install-wide work (it is not tied to a channel) and keep their count under a channel filter.
| Kind | Member |
|---|---|
| method | getCount(?Mrx\Light\Model\Channel\Channel $channel = null): int |
Mrx\Home\Api\CounterInterface
Interface.
| Kind | Member |
|---|---|
| method | getCount(): int |
Mrx\Home\Api\SetupCheckInterface
Interface.
| Kind | Member |
|---|---|
| method | isComplete(): bool |
Mrx\Home\Api\SetupDescriptionInterface
Interface. A setup step whose description depends on the store, such as the names of the installed payment providers. Registered as "description_provider" of the step's item in the pool setup_steps; the item's own "description" stays the text for when this returns ''.
| Kind | Member |
|---|---|
| method | getDescription(): string |
Mrx\Light\Api\AdvancedUrlInterface
Interface. Links to a stock screen in the advanced view (spec section 7). In simple mode a stock screen that a Light page replaces sends the admin to that page; PARAM keeps the stock screen open until the admin opens a Light page again. Admin area only: the preference lives in etc/adminhtml/di.xml.
| Kind | Member |
|---|---|
| const | PARAM = "mrx_stock" |
| method | get(string $route, array $params = []): string |
Mrx\Light\Api\AdvancedView\BackLinkProviderInterface
Interface. Decides the "Back to …" link of the advanced-view banner on stock screens a module owns.
| Kind | Member |
|---|---|
| method | getBackLink(string $fullActionName): ?array |
Mrx\Light\Api\Branding\Brand
Class. The brand the admin shows (spec 13.2). The view file ids of the brand pool are resolved to URLs, and a field the brand leaves out is ''. label, shortName and loginTagline hold the registered English: templates translate them.
| Kind | Member |
|---|---|
| property | $code: string readonly |
| property | $label: string readonly |
| property | $shortName: string readonly |
| property | $logoOnLight: string readonly |
| property | $logoOnDark: string readonly |
| property | $loginLockup: string readonly |
| property | $loginLockupOnDark: string readonly |
| property | $loginTagline: string readonly |
| property | $favicon: string readonly |
| property | $faviconType: string readonly |
| property | $defaultTheme: array readonly |
| property | $logoLockupOnDark: string readonly |
| method | __construct(string $code, string $label, string $shortName, string $logoOnLight, string $logoOnDark, string $loginLockup, string $loginLockupOnDark, string $loginTagline, string $favicon, string $faviconType, array $defaultTheme, string $logoLockupOnDark = "") |
Mrx\Light\Api\Branding\BrandInterface
Interface. The brand the admin shows: the entry of the brand pool with the highest priority that fits this platform and whose module is enabled (spec 13.2 and 13.3). Brands register in the admin area, so elsewhere this is the platform's name without logo files.
| Kind | Member |
|---|---|
| method | get(): Mrx\Light\Api\Branding\Brand |
Mrx\Light\Api\ExtensionApi
Class. The version of the Light extension API (spec section 8). Additions raise the minor version, removals and renames the major version. The API stays 0.x through the public beta that 0.1.0 launched; below 1.0.0 a caret range such as ^0.1 pins the minor, so a minor release may break. A module states its range in composer.json "extra.mrx-light-api".
| Kind | Member |
|---|---|
| const | VERSION |
| method static | satisfies(string $constraint): bool |
Mrx\Light\Api\FormOfAddressInterface
Interface. How a store view addresses its customers: informal ("je", "du") or formal ("u", "Sie"). Only the languages in the locales pool have two forms. Customer text in those languages loads i18n/<locale>.<form>.csv of every module on top of the language pack; admin text stays informal.
| Kind | Member |
|---|---|
| const | INFORMAL = "informal" |
| const | FORMAL = "formal" |
| const | XML_PATH = "mrx_light/locale/form_of_address" |
| method | forStore(int $storeId): ?string |
Mrx\Light\Api\Form\AfterCommitInterface
Interface. Optional, next to FormExtensionInterface: starts work once the entity is committed, such as a background job or a call to another system that must see the saved entity. The product editor calls it since 0.8.0; the category, discount, CMS page, CMS block and customer editors (form codes category, discount, cms_page, cms_block, customer_new and customer) since 0.11.0. Runs only when your namespace was posted, after the editor's commit and its reindex, never after a rollback.
| Kind | Member |
|---|---|
| method | afterCommit(Mrx\Light\Api\Form\FormContextInterface $context, array $input, bool $created): ?array |
Mrx\Light\Api\Form\AppliesToEntityInterface
Interface. Optional, next to FormExtensionInterface: sets values on the entity, so the entity's own save stores them once and REST, import and the advanced view see them (spec 6.2).
| Kind | Member |
|---|---|
| method | apply(Mrx\Light\Api\Form\FormContextInterface $context, array $input, object $entity): void |
Mrx\Light\Api\Form\CurrentFormInterface
Interface. The form the page shows. The editor's controller sets it before the page renders; cards read it. Null on a page that is no editor.
| Kind | Member |
|---|---|
| method | get(): ?Mrx\Light\Api\Form\FormContextInterface |
Mrx\Light\Api\Form\DeclaresFieldsInterface
Interface. Optional, next to FormExtensionInterface: Light draws the card from these fields (Mrx\Light\Block\Form\ExtensionCard) and checks the required ones before validate() runs (spec 6.2). A type this Light version doesn't know renders as text, so a module written for a later minor still works.
| Kind | Member |
|---|---|
| method | getFields(Mrx\Light\Api\Form\FormContextInterface $context): array |
Mrx\Light\Api\Form\DeclaresLanguageFieldsInterface
Interface. Optional, next to DeclaresFieldsInterface and AppliesToEntityInterface: names the declared fields that hold a value per store view. In an editor's language view Light draws only those fields, each with "Use default", and runs only extensions that implement this interface; any other extension shows nothing there.
| Kind | Member |
|---|---|
| method | getLanguageFields(Mrx\Light\Api\Form\FormContextInterface $context): array |
| method | loadLanguage(Mrx\Light\Api\Form\FormContextInterface $context): array |
Mrx\Light\Api\Form\FormContextInterface
Interface. The editor a form extension works in (spec 6.2): which form, which entity and which store view.
| Kind | Member |
|---|---|
| method | getFormCode(): string |
| method | getEntityId(): ?int |
| method | getEntity(): ?object |
| method | getStoreId(): int |
Mrx\Light\Api\Form\FormExtensionInterface
Interface. Adds fields to a Light editor and saves them with it (spec 6.2). Register it in the form_extensions pool of Mrx\Light\Model\Form\ExtensionPool under the form code and your extension code; the form posts your fields as ext[][], and you only receive your own namespace. Give the class #[RequiresModule] and register its Proxy, as in every object pool.
| Kind | Member |
|---|---|
| method | load(Mrx\Light\Api\Form\FormContextInterface $context): array |
| method | validate(Mrx\Light\Api\Form\FormContextInterface $context, array $input): array |
| method | save(Mrx\Light\Api\Form\FormContextInterface $context, array $input): ?array |
Mrx\Light\Api\IndexTable\ChannelFilterAwareInterface
Interface. Marks a provider that can filter its rows by channel (website). On a multi-channel install the table shows an "All channels / {channel}" select, keeps it in the page URL as ?channel=ID and passes the validated website id as Query::getChannelId() (also $query->filters['channel']).
| Kind | Member |
|---|---|
| const | FILTER_KEY = "channel" |
Mrx\Light\Api\IndexTable\ExtensionFilterTargetInterface
Interface. Marks a list that takes filters from FilterExtensionInterface. Its getRows() calls Mrx\Light\Model\IndexTable\ExtensionFilters::apply() (or applyToCollection()) on its rows and count queries.
| Kind | Member |
|---|---|
| method | getRowIdTable(): string |
Mrx\Light\Api\IndexTable\FilterDefinition
Class. One filter a list offers. Build it with a named constructor; a definition that breaks a rule throws \InvalidArgumentException when it is built, so the getFilters() that builds it throws: Light logs it and leaves out every filter that getFilters() declares (a list's own: the list shows no filters; an extension's: only its filters go). The rows still load.
| Kind | Member |
|---|---|
| const | TYPE_SELECT = "select" |
| const | TYPE_MULTISELECT = "multiselect" |
| const | TYPE_DATE_RANGE = "date_range" |
| const | TYPE_NUMBER_RANGE = "number_range" |
| const | TYPE_BOOLEAN = "boolean" |
| const | TYPE_HIDDEN = "hidden" |
| const | DATE_PRESETS[] = "today" |
| const | DATE_PRESETS[] = "yesterday" |
| const | DATE_PRESETS[] = "last_7_days" |
| const | DATE_PRESETS[] = "last_30_days" |
| const | DATE_PRESETS[] = "this_month" |
| const | DATE_PRESETS[] = "last_month" |
| const | KEY_PATTERN = "/^[a-z][a-z0-9_]{0,31}$/" |
| const | RESERVED_KEYS[] = "tab" |
| const | RESERVED_KEYS[] = "q" |
| const | RESERVED_KEYS[] = "sort" |
| const | RESERVED_KEYS[] = "dir" |
| const | RESERVED_KEYS[] = "page" |
| const | RESERVED_KEYS[] = "limit" |
| const | RESERVED_KEYS[] = "channel" |
| const | RESERVED_KEYS[] = "filter" |
| const | RESERVED_KEYS[] = "provider" |
| const | RESERVED_KEYS[] = "key" |
| const | RESERVED_KEYS[] = "form_key" |
| const | RESERVED_KEYS[] = "isAjax" |
| const | RESERVED_KEYS[] = "id" |
| const | BOOLEAN_YES = "yes" |
| const | BOOLEAN_NO = "no" |
| const | MAX_VALUE_LENGTH = 64 |
| const | DEFAULT_OPTION_LIMIT = 50 |
| const | MAX_OPTION_LIMIT = 1000 |
| method static | select(string $key, string $label, Mrx\Light\Api\IndexTable\FilterOptionsInterface|array $options): Mrx\Light\Api\IndexTable\FilterDefinition |
| method static | multiselect(string $key, string $label, Mrx\Light\Api\IndexTable\FilterOptionsInterface|array $options): Mrx\Light\Api\IndexTable\FilterDefinition |
| method static | dateRange(string $key, string $label, array $presets = self::DATE_PRESETS): Mrx\Light\Api\IndexTable\FilterDefinition |
| method static | numberRange(string $key, string $label, ?string $currency = null, int $decimals = 2): Mrx\Light\Api\IndexTable\FilterDefinition |
| method static | boolean(string $key, string $label, string $yesLabel, string $noLabel): Mrx\Light\Api\IndexTable\FilterDefinition |
| method static | hidden(string $key): Mrx\Light\Api\IndexTable\FilterDefinition |
| method | getKey(): string |
| method | getLabel(): string |
| method | getType(): string |
| method | isHidden(): bool |
| method | getOptions(): array |
| method | getOptionSource(): ?Mrx\Light\Api\IndexTable\FilterOptionsInterface |
| method | isLazy(): bool |
| method | getPresets(): array |
| method | getCurrency(): ?string |
| method | getDecimals(): int |
| method | withOptionLimit(int $limit): Mrx\Light\Api\IndexTable\FilterDefinition |
| method | getOptionLimit(): int |
Mrx\Light\Api\IndexTable\FilterExtensionInterface
Interface. Adds filters to another module's list, registered in Mrx\Light\Model\IndexTable\ExtensionPool like a ProviderExtensionInterface (a class may implement both, or only this one). Only a list that implements ExtensionFilterTargetInterface takes them.
| Kind | Member |
|---|---|
| method | getFilters(): array |
| method | getMatchingIds(string $key, Mrx\Light\Api\IndexTable\FilterValue $value, Mrx\Light\Model\IndexTable\Query $query): Magento\Framework\DB\Select |
Mrx\Light\Api\IndexTable\FilterOptionsInterface
Interface. Options of a select or multiselect filter that are too long or too costly to ship with the page (categories, countries, products). The list asks for them through light/table/options when the merchant opens the filter.
| Kind | Member |
|---|---|
| method | getOptions(string $search = "", int $limit = 50): array |
| method | getLabels(array $values): array |
Mrx\Light\Api\IndexTable\FilterValue
Class. A filter value Light parsed and validated against its FilterDefinition, as Query::getFilterValue() returns it. Bind what it returns; never put it into SQL as text.
| Kind | Member |
|---|---|
| method static | ofValues(string $type, array $values): Mrx\Light\Api\IndexTable\FilterValue |
| method static | ofDateRange(string $raw, ?DateTimeImmutable $from, ?DateTimeImmutable $to, ?string $preset = null): Mrx\Light\Api\IndexTable\FilterValue |
| method static | ofNumberRange(?float $min, ?float $max): Mrx\Light\Api\IndexTable\FilterValue |
| method | getType(): string |
| method | getValues(): array |
| method | getFrom(): ?DateTimeImmutable |
| method | getTo(): ?DateTimeImmutable |
| method | getPreset(): ?string |
| method | getMin(): ?float |
| method | getMax(): ?float |
| method | getRaw(): string |
Mrx\Light\Api\IndexTable\FilterableProviderInterface
Interface.
| Kind | Member |
|---|---|
| method | getFilters(): array |
Mrx\Light\Api\IndexTable\ProviderExtensionInterface
Interface. Adds columns and bulk actions to another module's table (registered in Mrx\Light\Model\IndexTable\ExtensionPool).
| Kind | Member |
|---|---|
| method | getColumns(): array |
| method | getBulkActions(): array |
| method | decorateRows(array $rows, Mrx\Light\Model\IndexTable\Query $query): array |
Mrx\Light\Api\IndexTable\ProviderInterface
Interface.
| Kind | Member |
|---|---|
| const | TYPE_TEXT = "text" |
| const | TYPE_LINK = "link" |
| const | TYPE_BADGE = "badge" |
| const | TYPE_MONEY = "money" |
| const | TYPE_DATE = "date" |
| const | TYPE_THUMBNAIL = "thumbnail" |
| const | TYPE_NUMBER = "number" |
| const | TYPE_TAGS = "tags" |
| const | TYPE_CHANNEL = "channel" |
| const | TYPE_LANGUAGE = "language" |
| method | getAclResource(): string |
| method | getColumns(): array |
| method | getTabs(): array |
| method | getDefaultSort(): array |
| method | getSearchPlaceholder(): string |
| method | getBulkActions(): array |
| method | getEmptyState(): array |
| method | getRows(Mrx\Light\Model\IndexTable\Query $query): array |
Mrx\Light\Api\IndexTable\RowActionsInterface
Interface. A "More actions" menu at the end of each row. Implement it on a table provider, or on a ProviderExtensionInterface to add actions to another module's table; an extension's keys then start with "_".
| Kind | Member |
|---|---|
| method | getRowActions(): array |
Mrx\Light\Api\ModeInterface
Interface. The admin's interface mode (spec section 7). Admin area only: the preference lives in etc/adminhtml/di.xml, so a storefront, cron or CLI class can't inject it.
| Kind | Member |
|---|---|
| const | SIMPLE = "simple" |
| const | ADVANCED = "advanced" |
| method | get(): string |
| method | isSimple(): bool |
| method | isStockView(): bool |
| method | showsLight(): bool |
Mrx\Light\Api\Navigation\Badge
Class. One count, shown on a nav item, a pin, a palette entry and a Home to-do. It has no URL: a cached URL would carry one admin's secret key, so every place that shows a count links to its own target.
| Kind | Member |
|---|---|
| const | TONES[] = "critical" |
| const | TONES[] = "attention" |
| property | $count: int readonly |
| property | $tone: string readonly |
| property | $label: string readonly |
| method | __construct(int $count, string $tone = "attention", string $label = "") |
| method | getDisplay(): string |
Mrx\Light\Api\Navigation\BadgeCacheInterface
Interface. Works in every area (admin, storefront, REST, cron), so an observer can call it wherever an order or a request changes.
| Kind | Member |
|---|---|
| method | invalidate(string ...$itemKeys): void |
Mrx\Light\Api\Navigation\BadgeProviderInterface
Interface. The first counter contract, still read through the BadgePool "badges" argument: digits (optionally followed by "+") count, other text shows only while nothing else counts. Light caches the value per admin language and asks again at most once a minute, in a background request. New counters implement BadgeSourceInterface.
| Kind | Member |
|---|---|
| method | getBadge(): ?string |
Mrx\Light\Api\Navigation\BadgeReaderInterface
Interface. What the current admin sees for one nav item: every provider merged, the ACL applied. Admin area only, because the value depends on the signed-in admin's role and language.
| Kind | Member |
|---|---|
| method | get(string $itemKey): ?Mrx\Light\Api\Navigation\Badge |
Mrx\Light\Api\Navigation\BadgeSourceInterface
Interface. A count on a nav item, registered in the Mrx\Light\Model\Navigation\BadgePool "providers" argument. Light caches the value per admin language and asks again at most once per "ttl", in a background request.
| Kind | Member |
|---|---|
| method | getBadgeValue(): ?Mrx\Light\Api\Navigation\Badge |
Mrx\Light\Api\Navigation\ItemProviderInterface
Interface. Navigation items that can only be known at runtime (pinned apps, a module's own screens). Called at most once per request, on every simple-mode page, so read from a cache or one cheap query.
| Kind | Member |
|---|---|
| method | getItems(): array |
Mrx\Light\Api\PageHeader\ActionConditionInterface
Interface. The "condition" of a header action (spec section 7): whether the action shows on this request, for example only for simple products. It runs every time the page renders, so keep it cheap. A condition that throws leaves its action out and is logged.
| Kind | Member |
|---|---|
| method | isAvailable(Magento\Framework\App\RequestInterface $request): bool |
Mrx\Light\Api\Redirect\ConditionInterface
Interface. Optional per-entry check for simple-mode redirects, e.g. "only simple products".
| Kind | Member |
|---|---|
| method | shouldRedirect(Magento\Framework\App\RequestInterface $request): bool |
Mrx\Light\Api\Redirect\ParamsResolverInterface
Interface. Optional per-entry lookup for simple-mode redirects whose Light screen needs a parameter the stock URL doesn't carry, e.g. the order of an invoice. Such an entry is one-way: the mode switch can't map the Light page back to it.
| Kind | Member |
|---|---|
| method | resolve(Magento\Framework\App\RequestInterface $request): ?array |
Mrx\Light\Api\Search\GroupInterface
Interface.
| Kind | Member |
|---|---|
| method | getLabel(): string |
| method | getAclResource(): string |
| method | getSortOrder(): int |
| method | search(string $query, int $limit): array |
Mrx\Light\Api\SharePreview\CardImage
Class. A drawn card. Light sends it only when the mime is one of the two constants, the bytes are at most 5 MB and the image measures CardRendererInterface::WIDTH by HEIGHT.
| Kind | Member |
|---|---|
| const | MIME_JPEG = "image/jpeg" |
| const | MIME_PNG = "image/png" |
| property | $bytes: string readonly |
| property | $mime: string readonly |
| method | __construct(string $bytes, string $mime) |
Mrx\Light\Api\SharePreview\CardRendererInterface
Interface. One item of the share_card_renderers pool, keyed by card kind: draws the card a page shares when it has no image of its own. Light calls it when a platform fetches the signed card URL, and in the editors' share preview. The card is never written to disk.
| Kind | Member |
|---|---|
| const | WIDTH = 1200 |
| const | HEIGHT = 630 |
| method | render(Mrx\Light\Api\SharePreview\CardRequest $request): ?Mrx\Light\Api\SharePreview\CardImage |
| method | version(): string |
Mrx\Light\Api\SharePreview\CardRequest
Class. What a card shows. Light checked every path before a renderer sees it, and the title is at most 160 characters.
| Kind | Member |
|---|---|
| property | $kind: string readonly |
| property | $storeId: int readonly |
| property | $title: string readonly |
| property | $photoPath: string readonly |
| property | $logoPath: string readonly |
| property | $storeName: string readonly |
| method | __construct(string $kind, int $storeId, string $title, string $photoPath, string $logoPath, string $storeName) |
Mrx\Light\Api\SharePreview\ImageSourceInterface
Interface. One item of the share_image_sources pool: an image a page may share as og:image. Light asks the items by sort_order and the first answer wins, so return null for every page your source knows nothing about.
| Kind | Member |
|---|---|
| method | getImage(Mrx\Light\Api\SharePreview\ShareContext $context): ?Mrx\Light\Api\SharePreview\ShareImage |
Mrx\Light\Api\SharePreview\ShareContext
Class. What og:image is chosen for: the page kind, the loaded entity Light knows for it, the store view and og:title. Light builds it on every storefront page and in the editors' share preview, and passes it to each item of the share_image_sources pool until one answers.
| Kind | Member |
|---|---|
| const | KIND_PRODUCT = "product" |
| const | KIND_CATEGORY = "category" |
| const | KIND_CMS = "cms" |
| const | KIND_SEARCH = "search" |
| const | KIND_HOME = "home" |
| const | KIND_OTHER = "other" |
| property | $kind: string readonly |
| property | $storeId: int readonly |
| property | $title: string readonly |
| property | $entity: ?object readonly |
| method | __construct(string $kind, int $storeId, string $title, ?object $entity = null) |
Mrx\Light\Api\SharePreview\ShareImage
Class. An image a page shares: a finished URL, or a card for Light to sign and draw. A source can't build or sign a card URL itself: Light checks the kind, cuts the title to 160 characters, checks the photo and signs the URL.
| Kind | Member |
|---|---|
| property | $url: string readonly |
| property | $width: ?int readonly |
| property | $height: ?int readonly |
| property | $cardKind: string readonly |
| property | $cardTitle: string readonly |
| property | $cardPhoto: string readonly |
| method static | fromUrl(string $url, ?int $width = null, ?int $height = null): Mrx\Light\Api\SharePreview\ShareImage |
| method static | card(string $kind, string $title = "", string $photo = ""): Mrx\Light\Api\SharePreview\ShareImage |
| method | isCard(): bool |
Mrx\Light\Api\SharePreview\ShareUploadInterface
Interface. The merchant's share image uploads (the Share image field, Block\ShareImageField): one check before saving and one URL for showing, for every module's source and editor.
| Kind | Member |
|---|---|
| method | isValid(string $path): bool |
| method | toImage(mixed $path, int $storeId): ?Mrx\Light\Api\SharePreview\ShareImage |
Mrx\Light\Attribute\ProvidesNavItems
Class. Names the nav item keys an ItemProviderInterface class can return, so bin/magento mrx:light:doctor accepts the counters, to-dos and child items that point at them. Keys that only exist at runtime, such as one per record, stay out. The doctor reads it from the class and its parents and never instantiates the provider.
| Kind | Member |
|---|---|
| property | $keys: array readonly |
Mrx\Light\Attribute\RequiresModule
Class. Marks a class (provider, badge, extension, Light controller) as usable only while the named modules are enabled. Read by Mrx\Light\Model\ModuleGate, which also checks every parent class, so a generated Proxy or Interceptor carries the requirement of the class it extends.
| Kind | Member |
|---|---|
| property | $modules: array readonly |
Mrx\Light\Block\AdvancedHint
Class. "Only available in the advanced view. Open in advanced view" (spec section 7). Layout arguments: route, params, text, link_label, resource and module. It renders nothing without a route, or when the admin couldn't open the link: the resource is denied, the module is off, or the route's controller refuses the admin.
| Kind | Member |
|---|---|
| method | getLink(): string |
| method | getText(): string |
| method | getLinkLabel(): string |
| method | getIconHtml(): string |
Mrx\Light\Block\Form\ExtensionCard
Class. A card drawn from the fields a form extension declares (spec 6.2): adding fields to an editor takes one PHP class, one DI item and one layout block. Layout arguments: "extension" (the code in form_extensions), "title", and optionally "js", a RequireJS module with the card's form hooks (spec 6.3). It renders nothing on a page without a form, and for an extension this admin can't use or that declares no fields. In a language view it draws only the fields of an extension that implements DeclaresLanguageFieldsInterface, each with "Use default". An editor that holds every language on one page adds the layout argument "store_id" per panel; the card then draws that store view's fields under store[] and leaves the form hooks to the default card.
| Kind | Member |
|---|---|
| const | TYPES[] = "text" |
| const | TYPES[] = "textarea" |
| const | TYPES[] = "number" |
| const | TYPES[] = "select" |
| const | TYPES[] = "toggle" |
| method | getExtensionCode(): string |
| method | getTitle(): string |
| method | getFields(): array |
| method | hasLoadFailed(): bool |
| method | getHooksModule(): string |
| method | isLanguageView(): bool |
| method | getIconHtml(string $name): string |
Mrx\Light\Block\IndexTable
Class.
| Kind | Member |
|---|---|
| method | getProviderCode(): string |
| method | isAllowed(): bool |
| method | setFilters(array $filters): Mrx\Light\Block\IndexTable |
| method | isCard(): bool |
| method | getConfigJson(): string |
Mrx\Light\Block\PageHeader
Class.
| Kind | Member |
|---|---|
| method | setTitle(string $title): Mrx\Light\Block\PageHeader |
| method | getTitle(): string |
| method | setSubtitle(string $subtitle): Mrx\Light\Block\PageHeader |
| method | getSubtitle(): string |
| method | setBack(string $url, string $label = ""): Mrx\Light\Block\PageHeader |
| method | getBackUrl(): string |
| method | getBackLabel(): string |
| method | addBadge(string $label, string $tone = "neutral", string $progress = "", string $progressTone = ""): Mrx\Light\Block\PageHeader |
| method | getBadges(): array |
| method | setPrimaryAction(array $action): Mrx\Light\Block\PageHeader |
| method | getPrimaryAction(): ?array |
| method | addSecondaryAction(array $action): Mrx\Light\Block\PageHeader |
| method | getSecondaryActions(): array |
| method | addMoreAction(array $action): Mrx\Light\Block\PageHeader |
| method | getMoreActions(): array |
| method | renderAttributes(array $attributes): string |
Mrx\Light\Block\ShareImageField
Class. The Share image field of an editor: thumbnail, Replace and Remove, and a hidden input that posts the path under media (a JPEG or PNG uploaded through light/media/upload). It updates the share card of the search preview next to it and fires mrx:share-image-change (detail name, value, url) on its root after every change.
| Kind | Member |
|---|---|
| method | getName(): string |
| method | getValue(): string |
| method | getHtmlId(): string |
| method | getImageUrl(): string |
| method | getDefaultValue(): string |
| method | getDefaultImageUrl(): string |
| method | usesDefault(): bool |
| method | getPreviewSelector(): string |
| method | canUpload(): bool |
| method | getUploadUrl(): string |
Mrx\Light\Block\SlotOutline
Class. Marks a layout container that other modules can add blocks to. Page modules put one in each of their containers; it only shows in developer mode with ?mrx_slots=1, so developers and tests can see where to plug in.
| Kind | Member |
|---|---|
| const | PARAM = "mrx_slots" |
| method | getSlot(): string |
Mrx\Light\Controller\Adminhtml\AbstractPage
Abstract class.
| Kind | Member |
|---|---|
| const | ADMIN_RESOURCE = "Mrx_Light::light" |
| const | HANDLE = "mrx_page" |
| const | WIDTH_DEFAULT = "default" |
| const | WIDTH_NARROW = "narrow" |
| const | WIDTH_FULL = "full" |
| protected const | ACTIVE_MENU = "" |
| protected const | PAGE_WIDTH = "default" |
| protected property | $resultPageFactory: Magento\Framework\View\Result\PageFactory readonly |
| method | __construct(Magento\Backend\App\Action\Context $context, Magento\Framework\View\Result\PageFactory $resultPageFactory) |
| protected | getPageTitle(): Magento\Framework\Phrase|string |
| protected | createPage(Magento\Framework\Phrase|string $title): Magento\Backend\Model\View\Result\Page |
| protected | getPageHeader(Magento\Backend\Model\View\Result\Page $page): ?Mrx\Light\Block\PageHeader |
Mrx\Light\Model\Channel\Channel
Class.
| Kind | Member |
|---|---|
| property | $id: int readonly |
| property | $code: string readonly |
| property | $name: string readonly |
| property | $websiteName: string readonly |
| property | $baseUrl: string readonly |
| property | $rootCategoryId: int readonly |
| property | $defaultLanguageId: int readonly |
| property | $isDefault: bool readonly |
| property | $sortOrder: int readonly |
| property | $languages: array readonly |
| method | getDefaultLanguage(): ?Mrx\Light\Model\Channel\Language |
| method | getLanguage(int $storeId): ?Mrx\Light\Model\Channel\Language |
| method | getStoreIds(): array |
| method | isMultiLanguage(): bool |
| method | getHost(): string |
| method | toArray(): array |
Mrx\Light\Model\Channel\ChannelProvider
Class. A channel is a website and a language is a store view; store groups stay invisible (spec D11-D12).
| Kind | Member |
|---|---|
| method | getChannels(): array |
| method | getChannel(int $channelId): ?Mrx\Light\Model\Channel\Channel |
| method | hasChannel(int $channelId): bool |
| method | getChannelIds(): array |
| method | getDefaultChannel(): ?Mrx\Light\Model\Channel\Channel |
| method | getLanguages(): array |
| method | getLanguage(int $storeId): ?Mrx\Light\Model\Channel\Language |
| method | channelOfStore(int $storeId): ?Mrx\Light\Model\Channel\Channel |
| method | isMultiChannel(): bool |
| method | isMultiLanguage(?int $channelId = null): bool |
| method | getChannelsByRootCategory(int $categoryId): array |
| method | getChannelName(int $channelId): string |
| method | getStorefrontUrl(int $storeId, string $path = ""): string |
| method | toArray(): array |
| method | reset(): void |
Mrx\Light\Model\Channel\Language
Class.
| Kind | Member |
|---|---|
| property | $id: int readonly |
| property | $code: string readonly |
| property | $name: string readonly |
| property | $locale: string readonly |
| property | $channelId: int readonly |
| property | $isDefault: bool readonly |
| property | $isActive: bool readonly |
| property | $sortOrder: int readonly |
| property | $baseUrl: string readonly |
| property | $storefrontUrl: string readonly |
| method | toArray(): array |
Mrx\Light\Model\IndexTable\ExtensionFilters
Class. Applies the filters other modules add to a list (FilterExtensionInterface) as " IN ()". A list that implements ExtensionFilterTargetInterface calls it on its rows and count queries, with its own id column, so its table aliases stay its own. An extension that throws, or answers a Select with named binds, loses its filter; the list still loads.
| Kind | Member |
|---|---|
| method | apply(Magento\Framework\DB\Select $select, string $idColumn, Mrx\Light\Model\IndexTable\Query $query): void |
| method | applyToCollection(Magento\Framework\Data\Collection\AbstractDb $collection, string $idColumn, Mrx\Light\Model\IndexTable\Query $query): void |
Mrx\Light\Model\IndexTable\PageCounter
Class. One page of a list plus its total, at a bounded cost (proposal 7.3):
| Kind | Member |
|---|---|
| const | CAP = 10000 |
| method | fetchPage(Magento\Framework\DB\Select $select, Mrx\Light\Model\IndexTable\Query $query, ?bool $exact = null): array |
| method | count(Magento\Framework\DB\Select $select, bool $exact): array |
| method | countsExactly(Mrx\Light\Model\IndexTable\Query $query): bool |
Mrx\Light\Model\IndexTable\Query
Class.
| Kind | Member |
|---|---|
| property | $tab: string readonly |
| property | $search: string readonly |
| property | $sort: string readonly |
| property | $direction: string readonly |
| property | $page: int readonly |
| property | $pageSize: int readonly |
| property | $filters: array readonly |
| property | $values: array readonly |
| property | $provider: string readonly |
| method | getOffset(): int |
| method | isAscending(): bool |
| method | getFilter(string $key): ?string |
| method | getFilterValue(string $key): ?Mrx\Light\Api\IndexTable\FilterValue |
| method | getChannelId(): ?int |
| method | withPage(int $page): Mrx\Light\Model\IndexTable\Query |
Mrx\Light\Model\Redirect\Condition\HasParam
Class. Redirects only a stock screen that shows one record: without its id the same action is the stock "new" form (system_store/newWebsite forwards to editWebsite), which the Light record page can't show. A bridge names it as the type of a virtual type with its own "param", the way mrx:light:app writes it, so the name of that constructor argument is contract too. The surface leaves out the constructors DI calls; AppGeneratorTest pins this one.
| Kind | Member |
|---|---|
| method | shouldRedirect(Magento\Framework\App\RequestInterface $request): bool |
Mrx\Light\ViewModel\Icons
Class. Keep in sync with Mrx_Light/js/icons, which renders the same set in the browser.
| Kind | Member |
|---|---|
| method | render(string $name, string $class = "", string $label = ""): string |
| method | has(string $name): bool |
| method | getNames(): array |
| method | getRegisteredPaths(): array |
Mrx\Orders\Api\DraftProductTypeInterface
Interface. Lets a manual order offer a product type Orders doesn't handle itself (simple, virtual and configurable stay internal). One provider per Magento type id in the draft_product_types pool.
| Kind | Member |
|---|---|
| method | isSupported(Magento\Catalog\Api\Data\ProductInterface $product): bool |
| method | getFields(Magento\Catalog\Api\Data\ProductInterface $product, int $storeId): array |
| method | buildRequest(Magento\Catalog\Api\Data\ProductInterface $product, array $values, float $qty): Magento\Framework\DataObject |
Mrx\Orders\Api\OrderActionConditionInterface
Interface.
| Kind | Member |
|---|---|
| method | isAvailable(Magento\Sales\Api\Data\OrderInterface $order): bool |
Mrx\Orders\Api\OrderPageContextInterface
Interface. The order the Light order page shows. A card in one of the page's containers asks for this interface and gets the page's own view model, so it never loads the order a second time.
| Kind | Member |
|---|---|
| method | getOrder(): ?Magento\Sales\Api\Data\OrderInterface |
Mrx\Orders\Api\PaymentMode
Class. How a payment module tells Light that a payment was made in its test mode: it stores INFO_KEY => TEST in the payment's additional information (LIVE for a real one). The order page then warns while the order is open that no money was received, for any provider; the provider's name comes from its payment_providers item.
| Kind | Member |
|---|---|
| const | INFO_KEY = "mrx_payment_mode" |
| const | TEST = "test" |
| const | LIVE = "live" |
Mrx\Orders\Api\RefundReasonInterface
Interface. Magento's RefundInvoice turns every refund failure into "Could not save a Creditmemo". A payment module that refuses a refund sets one sentence here before it throws; the refund then fails with that sentence instead.
| Kind | Member |
|---|---|
| method | set(string $reason): void |
| method | take(): ?string |
Mrx\Orders\Api\TimelineProviderInterface
Interface.
| Kind | Member |
|---|---|
| method | getEvents(Magento\Sales\Api\Data\OrderInterface $order): array |
Mrx\Orders\Api\TotalsProviderInterface
Interface.
| Kind | Member |
|---|---|
| method | getRows(Magento\Sales\Api\Data\OrderInterface $order): array |
Mrx\Settings\Api\ChannelPaymentProviderStateInterface
Interface. A provider state that can answer for one channel. Implement it instead of PaymentProviderStateInterface when the provider can be connected or switched on per channel (website): Settings > Payments then asks isOfferedIn() for the channel it saves, so a provider that is on in that channel only counts there, and one that is off there doesn't. A state that implements only PaymentProviderStateInterface is asked isOffered() for every channel, as before.
| Kind | Member |
|---|---|
| method | isOfferedIn(?int $channelId): bool |
Mrx\Settings\Api\ChannelScopedInterface
Interface. Marks a settings page whose fields can differ per channel: it shows "Applies to", and a stock configuration link that names a website opens it with that channel selected.
| Kind | Member |
|---|---|
| const | PARAM = "channel" |
Mrx\Settings\Api\Data\LocationInterface
Interface. One location, read only. Change the business address in Business details, a location in Settings > Locations or through Magento's source repository.
| Kind | Member |
|---|---|
| method | getCode(): string |
| method | getName(): string |
| method | getAddressLines(): array |
| method | getPhone(): string |
| method | isEnabled(): bool |
| method | sellsOnline(): bool |
| method | isPickup(): bool |
| method | getPickupName(): string |
| method | getOpeningHours(): string |
| method | getPickupInstructions(): string |
| method | getReadyTime(): string |
| method | getPosition(): int |
| method | getChannelIds(): array |
Mrx\Settings\Api\Data\VatOutcomeCellInterface
Interface. What Magento charges one kind of customer in one country for one tax class, and whether that is what the shop's VAT mode requires. A cell with an empty country speaks for every country at once.
| Kind | Member |
|---|---|
| const | KIND_CONSUMER = "consumer" |
| const | KIND_BUSINESS = "business" |
| const | KIND_OTHER = "other" |
| const | KIND_SHIPPING = "shipping" |
| const | KIND_STORE_RATE = "store_rate" |
| const | STATUS_PASS = "pass" |
| const | STATUS_WARN = "warn" |
| const | STATUS_NOTE = "note" |
| const | STATUS_UNCHECKED = "unchecked" |
| method | getKind(): string |
| method | getCountry(): string |
| method | getCustomerClassId(): int |
| method | getProductClassId(): int |
| method | getPercent(): ?float |
| method | getExpectedPercent(): ?float |
| method | getStatus(): string |
| method | getReason(): string |
| method | getRules(): array |
| method | getCountries(): array |
Mrx\Settings\Api\Data\VatOutcomeResultInterface
Interface. The answer of one VAT outcome check, with its answers grouped per website.
| Kind | Member |
|---|---|
| const | STATUS_CHECKED = "checked" |
| const | STATUS_OTHER_ENGINE = "other_engine" |
| const | STATUS_ENGINE_UNREAD = "engine_unread" |
| const | STATUS_NOT_CHECKED = "not_checked" |
| method | getStatus(): string |
| method | getComputedAt(): int |
| method | getCellCount(): int |
| method | getWebsites(): array |
| method | getWarnings(): array |
| method | getEngines(): array |
Mrx\Settings\Api\LegalPageVariablesInterface
Interface. Extra placeholders for legal page drafts in one language, such as the register line a German Impressum needs. Named as "variables" by the drafts' items in Mrx\Settings\Model\LegalPages\Templates (catalogue pool legal_page_templates).
| Kind | Member |
|---|---|
| method | getVariables(string $type, int $storeId, array $values): array |
Mrx\Settings\Api\LocationsInterface
Interface. The places a shop keeps stock and customers pick up. In simple mode there is exactly one location: the business address from Business details, with code ''. Settings answers simple mode on every shop, with or without Magento's inventory modules. Mrx_Locations replaces it on a shop with those modules: with two or more enabled sources every enabled source is a location, except Magento's default source.
| Kind | Member |
|---|---|
| method | isAvailable(): bool |
| method | isMultiLocation(): bool |
| method | getLocations(bool $includeDisabled = false): array |
| method | getMain(): ?Mrx\Settings\Api\Data\LocationInterface |
| method | getForChannel(int $websiteId): array |
Mrx\Settings\Api\NormalizesInputInterface
Interface. Pages that store a cleaned-up version of what was typed ("nl 1234.56.789.b01" becomes "NL123456789B01") return those values after save, so the form shows what was actually saved.
| Kind | Member |
|---|---|
| method | getNormalizedValues(): array |
Mrx\Settings\Api\OssInterface
Interface. VAT on sales to consumers in other EU countries, the One Stop Shop (Settings > Taxes, "Sales to other EU countries"). A module that sets up the home country's rates asks it, so its own status reads the right basis, and lets it add its rates first: without them its check would see orders to other EU countries at 0%.
| Kind | Member |
|---|---|
| method | isUsed(): bool |
| method | addRates(): array |
Mrx\Settings\Api\PageInterface
Interface. A settings page under light/settings. Register it in the "pages" argument of Mrx\Settings\Model\Page\Pool, keyed by its code: as an object, or as an array schema that Light turns into a page (spec section 4).
| Kind | Member |
|---|---|
| method | getAclResources(): array |
| method | getCacheTypes(): array |
| method | save(array $data): string |
Mrx\Settings\Api\PaymentMethodsInterface
Interface. The question a payment provider module asks before it lets the merchant switch it off: can customers still pay another way?
| Kind | Member |
|---|---|
| method | hasOtherCheckoutMethod(string $exceptPrefix, ?int $channelId): bool |
Mrx\Settings\Api\PaymentProviderCardInterface
Interface. What Settings > Payments shows on a provider's card. Registered as "card" of the provider's item in the pool payment_providers; a provider with own_section and a card gets core's card, its forms go into the card's panels (block mrx.settings.payments.online, children "_connection" and "_methods"). Every method answers from stored config or the provider module's own cache: a page render never waits for the provider's API.
| Kind | Member |
|---|---|
| const | STATUS_NOT_CONNECTED = "not_connected" |
| const | STATUS_OFF = "off" |
| const | STATUS_TEST = "test" |
| const | STATUS_NO_METHODS = "no_methods" |
| const | STATUS_LIVE = "live" |
| method | getStatus(?int $channelId): string |
| method | getAccountName(?int $channelId): string |
| method | getMethods(?int $channelId): array |
| method | getAdvancedRows(?int $channelId): array |
Mrx\Settings\Api\PaymentProviderStateInterface
Interface. Whether a payment provider module takes payments right now. Registered as "state" of the provider's item in the pool payment_providers (Mrx\Settings\Model\Payments\ProviderDetector, argument "providers"). While isOffered() is false, Settings > Payments counts the provider's methods as off, so it doesn't let the merchant switch off the last method customers can really pay with.
| Kind | Member |
|---|---|
| method | isOffered(): bool |
Mrx\Settings\Api\ReloadsAfterSaveInterface
Interface. A page whose save changes what the page itself shows beyond its own fields (channel notes, names in the header), so the form reloads after saving instead of staying as it is.
| Kind | Member |
|---|---|
| method | shouldReload(): bool |
Mrx\Settings\Api\ReverseChargeInterface
Interface. 0% VAT for businesses with a valid VAT number in another EU country (Settings > Taxes, "Business customers in other EU countries"). Magento's own VAT number check moves such a customer to a group on a customer tax class that no tax rule charges. Documents, order pages and exports ask here whether an order was reverse charged.
| Kind | Member |
|---|---|
| method | isOn(): bool |
| method | getCustomerClassId(): ?int |
| method | getGroupId(): ?int |
| method | isReverseCharged(Magento\Sales\Api\Data\OrderInterface $order): bool |
| method | getCustomerVatNumber(Magento\Sales\Api\Data\OrderInterface $order): string |
Mrx\Settings\Api\ScopedConfigWriterInterface
Interface. Saves config values at one scope: all channels (both ids null), one channel (a website) or one store view. Values go through Magento\Config\Model\Config, so backend models run. For a channel, a value equal to what the channel reads now is not written, and any other value becomes the channel's own, also one equal to the all-channels value; pass null to remove it so the channel follows all channels again. A masked secret ("******") is never written. Admin area only: the preference lives in etc/adminhtml/di.xml, because Magento loads system.xml, and with it the backend models, in the admin only.
| Kind | Member |
|---|---|
| method | save(array $values, ?int $websiteId = null, ?int $storeId = null): array |
Mrx\Settings\Api\SettingsValidatorInterface
Interface. Checks a schema settings page (its "validator" key) after the system.xml validate classes passed.
| Kind | Member |
|---|---|
| method | validate(array $values, ?int $websiteId): array |
Mrx\Settings\Api\ShopStateInterface
Interface. Whether the shop is still fresh. A module asks it to tell a shop that gets setup defaults from a running one, where changing a setting changes what existing orders and prices mean. Its own interface, not a method on VatOutcomeInterface, so classes that implement that one keep working.
| Kind | Member |
|---|---|
| method | isShopEmpty(): bool |
Mrx\Settings\Api\ValidationException
Class. Field errors of a settings save. The page answers 422 with "errors", and the form shows each message under the input of that name.
| Kind | Member |
|---|---|
| method | __construct(array $errors, ?Magento\Framework\Phrase $phrase = null) |
| method | getErrors(): array |
Mrx\Settings\Api\VatOutcomeInterface
Interface. What customers pay: Magento's own tax calculator is asked what each kind of customer pays in each EU country, and the answer is compared with what the shop's VAT mode requires (Settings > Taxes, "What your customers pay"). A country pack asks it instead of running a check of its own.
| Kind | Member |
|---|---|
| method | check(?int $websiteId = null): Mrx\Settings\Api\Data\VatOutcomeResultInterface |
| method | getLastResult(?int $websiteId = null): ?Mrx\Settings\Api\Data\VatOutcomeResultInterface |
Mrx\Settings\Api\ZonesWriterInterface
Interface. Saves a shop's shipping zones for all channels, the way Settings > Shipping stores them. A country module that seeds zones for its country uses it once, from a data patch, while the shop has no zones yet.
| Kind | Member |
|---|---|
| method | hasZones(): bool |
| method | save(array $zones): void |
Mrx\Settings\Controller\Adminhtml\Settings\AbstractSettingsPage
Abstract class.
| Kind | Member |
|---|---|
| const | ADMIN_RESOURCE = "Magento_Config::config" |
| protected const | ACTIVE_MENU = "Magento_Config::system_config" |
| protected const | PAGE_CODE = "" |
| const | SETTINGS_HANDLE = "mrx_settings_page" |
| protected property | $pool: Mrx\Settings\Model\Page\Pool readonly |
| method | __construct(Magento\Backend\App\Action\Context $context, Magento\Framework\View\Result\PageFactory $resultPageFactory, Mrx\Settings\Model\Page\Pool $pool) |
| protected | getPageCode(): string |
Mrx\Settings\Model\Ai\UnitCounterInterface
Interface. What a row of the Cost calculator counts when its unit isn't the product: a module counts, Light multiplies. The option-label row counts the calls a run would make, which only Disrex_AiCatalog's dry run knows.
| Kind | Member |
|---|---|
| method | count(int $websiteId): int |
Mrx\Settings\Model\Page\ChannelScopedInterface
Interface. Deprecated since 0.1.0.
Mrx\Settings\Model\Page\PageInterface
Interface. Deprecated since 0.1.0.
Mrx\Settings\Model\Tax\PriceDisplay
Class. "Prices include tax" as one switch: entered prices, shipping prices and every place prices are shown follow it.
| Kind | Member |
|---|---|
| method | includesTax(): bool |
| method | getConfig(bool $includesTax): array |
Mrx\Settings\Model\Tax\TaxRecords
Class. Every tax rate and rule, loaded once per request: one render of the Taxes page needs them in a tax setup's status, the OSS rates and the rates table. Rates and rules are saved through here, so the next read sees the change.
| Kind | Member |
|---|---|
| method | getRates(): array |
| method | getRules(): array |
| method | findRule(string $code): ?Magento\Tax\Api\Data\TaxRuleInterface |
| method | getRuleRateIds(): array |
| method | ratedCountries(): array |
| method | rulesCharging(string $country): array |
| method | customerClassId(): int |
| method | productClassIds(): array |
| method | customerClassNames(): array |
| method | isWholeCountry(Magento\Tax\Api\Data\TaxRateInterface $rate): bool |
| method | saveRate(Magento\Tax\Api\Data\TaxRateInterface $rate): Magento\Tax\Api\Data\TaxRateInterface |
| method | saveRule(Magento\Tax\Api\Data\TaxRuleInterface $rule): Magento\Tax\Api\Data\TaxRuleInterface |
| method | deleteRate(int $rateId): void |
Mrx\Settings\Model\ValidationException
Class. Deprecated since 0.1.0.
Mrx\Settings\ViewModel\Fields
Class. The form controls of Light's settings pages, for a module's own settings template (layout argument "fields"): the same markup, channel note and lock state as core's pages. A control with a "path" option shows the note of that setting for the page's channel ("Changed for …" with its reset link, the lock note, or "… uses its own value" under All channels) and is disabled while the setting can't differ per channel. Under it, each store view with a value of its own from the advanced view gets a note that names its language ("Changed for Deutsch in the advanced view") with a button that removes that value on save. Every value passed in is escaped here, except "help_html", which the caller escaped.
| Kind | Member |
|---|---|
| method | icon(string $name, string $class = ""): string |
| method | idFor(string $name): string |
| method | field(string $name, string $label, string $value, array $options = []): string |
| method | select(string $name, string $label, array $choices, string $value, array $options = []): string |
| method | multiselect(string $name, string $label, array $choices, array $values, array $options = []): string |
| method | toggle(string $name, string $label, bool $checked, array $options = []): string |
Last updated on