Skip to content

Extension points

phil/directory-bundle

What an application configures, overrides, decides or relies on. Listings are contents of phil/content-bundle, and addresses, contact cards and positions come through phil/address-bundle, phil/contact-bundle and phil/geo-bundle.

Configuration

OptionWhat it extends
genresThe kinds of listing, each with its path and title
relationsHow listings of one genre point at another's, one or many, with a title each way
admin_roleThe role that publishes, changes every listing and names editors
publish_every_changeWhether a change is published at once or kept as a draft
page_size, sitemap_localeThe list of a genre, and the locale the sitemap lists
wordsThe words of the addresses, new, edit, in the site's language

See Configuration.

Access

The voter attributes phil_directory.edit, phil_directory.editors and phil_directory.publish decide who changes, manages and publishes a listing; a voter of the application's own on the same attributes adds its rules. Users are read from the security token's getUserIdentifier(). See Listings.

Templates and words

PointHow
The pages@PhilDirectory/index, show, form, editors and history, each extending layout.html.twig, overridden in templates/bundles/PhilDirectoryBundle/ — see Routes and pages
Showing a name rather than an identifierThe editors and history templates overridden
LabelsThe phil_directory translation domain
The formsA form type extension of the application's on the listing and editor forms

Ports

PortShippedWhat the application's own does
Phil\DirectoryBundle\Application\UserErasureDoctrineUserErasureerase(string $user): int — takes a user's identifier off every listing and version, in one transaction; returns how many changed
Phil\DirectoryBundle\Application\RelatedLookupDoctrineRelatedLookuppointingAt(string $genre, string $relation, string $resourceId): array — the listings of a genre whose relation points at a resource

Services

PointHow
DirectoryCreates, edits, names editors, publishes and erases users in code
The sitemapDirectoryUrlProvider is tagged phil_sitemap.url_provider: one section per genre
The capabilities of a listingContactCapable, AddressCapable, LocationCapable, RelatedCapable and EditedByCapable, mapped for phil/content-bundle through phil_content.capability_mapping