Helpers
Table of Contents
Namespaces
- Filters
- Forms
- Sitemap
Classes
- ApproximatePrice
- Approximate amount conversion between currencies using the manual rate `cms_system_currencies.exchange_rate`.
- ArrayHelper
- AssetPathResolver
- Converts a relative (public) asset path to an absolute path on disk, so that the
{@see \App\Core\Base\Shared\System\Models\Entities\Asset} entity can check that the file
exists ({@see \App\Core\Base\Shared\System\Models\ValueObjects\AssetVariant::exists()}).
- AssetPlaceholderHelper
- Placeholder image for an asset whose file cannot be loaded; the single source of truth for
{@see \App\UI\Front\System\Components\AssetRendererComponent\AssetRenderer} and
{@see \App\UI\Front\System\Components\GalleryComponent\Traits\InitTrait}.
- AssetSrcset
- Builds `srcset` from image variants. Pure logic without disk or entity access, so it is
tested standalone. Variant files come from `Asset::getVariantFiles()`, the set of existing
folders is supplied by the caller ({@see \App\UI\Front\System\Components\AssetRendererComponent\AssetRenderer}).
- AssetVariantBackfill
- Pure logic of regenerating missing image variants and deleting originals. No disk or DB, so it
is covered by a unit test ({@see \Tests\Unit\System\AssetVariantBackfillTest}). Disk access
(file existence, dimensions) and writes come from
{@see \App\UI\Api\System\Models\Managers\AssetVariantRegenerationManager}.
- AssetVariantLegacyHelper
- Migrates legacy ImageVariantEntity serialized objects to plain arrays.
- AssetVariantPlan
- Pure functions of image variants stored in the DB. No DB or DI, so they can be covered by a
unit test ({@see \Tests\Unit\System\AssetVariantPlanTest}).
- BatchDelete
- Retention `DELETE` in batches (`LIMIT`) instead of one unbounded statement.
- ClassHelper
- CountryCodeList
- A stored list of ISO 3166-1 alpha-2 codes ("CZ,SK") — the delivery coverage of a shipper
region (`cms_mod_eshop_shipper_regions.country_codes`). An empty list means "no
restriction", so regions configured before the column existed keep working unchanged.
- CountryOptionsHelper
- Order of the country select: Czechia and Slovakia
first (the portal's home markets), then alphabetically by the name in the UI language (diacritics-insensitive —
no `ext-intl` Collator at runtime, it is not a composer requirement).
- CrawlerDetector
- Recognises automated clients by their User-Agent.
- CurrencyUnitFormatter
- Builds the unit after an amount from the currency translation
({@see \App\Core\Base\Shared\System\Models\Entities\CurrencyText}::getUnitLabel) for the current
language and pluralizes it by count. `unit_label` is a Symfony interval/plural pattern,
e.g. `{0}credits|[1,4]credit|[5,Inf]credits`.
- Date
- DateTimeHelper
- DbValue
- Typed reading of values from DB rows and `mixed` inputs (DBAL `fetchAssociative()` /
`fetchOne()`, request parameters, form arrays).
- Decimal
- Decimal number from user input to a numeric-string.
- DisplayRegionResolver
- Single source of currency and VAT for displaying prices on the website: the payment region.
- DocumentLocale
- Language and format for the customer. Order e-mails and invoices are rendered not by who
generates them (admin in Czech, cron without a language) but by the order:
- DomainTranslator
- Translator with a domain prefix for components and templates. Components get the
`Nette\Localization\Translator` interface injected, but only the Contributte translator can prefix
(it always runs in the application); any other is a wiring error, not a silently untranslated text.
- EditorHtmlSanitizer
- Server-side sanitization of HTML from the parameter editor (ParameterForm with `useEditor`).
- EmailHelper
- EntityId
- Id of a generic entity (type `object` / `BaseEntity` / generic entity template).
- HtmlOutline
- Outline of a text page: extracts headings from HTML and adds anchors to them.
- IpRange
- IP address or prefix range (IPv4 and IPv6), as stored in the IP blacklist (`cms_system_blacklists`, type 1).
- KeysetBatches
- Reads a large set in batches by key (`id > last id`, `ORDER BY id`, `LIMIT n`).
- LocalizedSettingKey
- Language variants of a setting key: `<base key>.<language alias>`.
- LocationHelper
- LogRedactor
- Builds non-identifying traces of personal data and secrets for operational logs.
- ParameterContentHelper
- Applies the content filters of a parameter (`disallowUrl`, `disallowBlacklistedWords`) in one phase.
- PendingPublicationNotice
- Picks the notice shown to the author after an advert, company profile or discussion post is submitted from the front end.
- PhoneHelper
- PriceHelper
- PrivateDownloadHeaders
- Cache headers for downloads that passed an authorization check (invoice PDFs,
complaint attachments, import logs, exports).
- QuantityFormat
- The one place that decides how a quantity (and a decimal amount with the same rules) is shown to people:
a whole number without decimals ("2"), a real decimal with the needed places only ("2,5", "2,25").
- RequestParamShape
- Strict shape parser for parameters of external Api actions (`action*()` reading
`getRequestParameters()`).
- RouteMaskHelper
- Parses the `cms_system_routes.mask` route mask (Nette route mask syntax, see
`Route::parseMask()`/`compileUrl()` in `nette/routing`) and returns the names of required
parameters, i.e. those `Route::constructUrl()` refuses to leave out.
- SafeUnserialize
- Reads legacy PHP-serialized columns/session values that are expected to hold
only arrays and scalars (e-mail queue reply-tos/files, favourites, asset variants).
- SearchTerm
- Search text typed by a user, prepared for the `s-<search>` segment of list routes.
- SettingSecrecy
- Defines in one place which setting keys must never reach a browser response.
- SlugHelper
- Fast replacement of {@see Strings::webalize()} for hot paths (router translators).
- SqlMigrationPlanner
- Selects the SQL migrations a deployment has to run (`bin/migrate.php`).
- StagedFileSet
- Publishes a set of files (sitemaps, buckets) atomically into one directory.
- StringHelper
- Static string helpers: conversion between name formats, slugs, truncation and prefix checks.
- TaxIdHelper
- Keeps the shape of company registration and VAT ids in one place.
- TextLinkifier
- Turns web addresses written in text into clickable links (the paid "Show links" tariff of
Discussion, Bazaar and Comcat).
- ThemeHelper
- TranslationFallback
- Picks an entity translation with a fallback to the default language.
- TreeStructure
- UploadFormats
- Builds a readable list of accepted formats for the upload zone hint ("JPG, PNG, PDF").
- UploadLimit
- Computes the effective file upload limit: the smallest of the application limit and the PHP limits.
- UrlHelper
- VatIdCheckStatus
- UI state of a VAT id verification answer (`api/system/vat-id-check/verify`) — one mapping
for the Front profile and the admin badges / flash messages. Pure: works on the bridge array, no I/O.
- VatRate
- VAT rate (percent) as a numeric-string — the single place that says how a rate is parsed,
stored, keyed and displayed.