Skip to content

API reference

phil/content-bundle

Every class and interface of the bundle, by layer. All namespaces are under Phil\ContentBundle. "Port" is an interface the application may implement or replace; "implemented" is a class the bundle provides. Every entry here is implemented and tested; what is not started is listed at the end.

Bundle class

ClassRole
PhilContentBundleThe AbstractBundle: configuration tree under phil_content, the tag constants (DATA_MAPPER_TAG, MERGER_TAG, NORMALIZER_TAG, CAPABILITY_MAPPING_TAG), the Doctrine configuration prepended with DoctrineBundle, and the services (configuration.md)

Domain

Domain\Content

ClassKindRole
ContentRootportA root: createDimensionContent(DimensionKey)
DimensionContentportA row: root(), dimension()
AbstractContentRootimplemented, mapped superclassBase of the application's root entities: dimensionContentClass(), resourceKey()
AbstractDimensionContentimplemented, mapped superclassBase of the application's row entities: identifier and dimension columns, final constructor
DimensionContentIdimplementedUUIDv7 surrogate identifier of a row (Identifier of phil/ddd-bundle)

Domain\Dimension

ClassKindRole
DimensionKeyimplementedLocale (or none), stage and version of a row
Stageimplemented, enumDraft, Live
DimensionLocalesimplementedA locale parsed and its chain found, refused as InvalidDimension

Locale, Version, FallbackChain and DeclaredLocales are the value objects of phil/locale-dimensions.

Domain\Capability

ClassKindRole
TemplateCapable, TemplateTraitport and traitTemplate key and field values
WorkflowCapable, WorkflowTraitport and traitWorkflow place and last publication date
SeoCapable, SeoTraitport and traitSEO title, description, keywords, canonical URL, three directives
ExcerptCapable, ExcerptTraitport and traitTeaser title, description, image reference
LinkCapable, LinkTraitport and traitA Link
RoutableCapable, RoutableTraitport and traitA Slug
BodyCapable, BodyTraitport and traitA Body
CapabilityTextimplementedThe checks of free-text values (text(), line(), reference())

Domain\ValueObject

ClassRole
BodySource, MarkupFormat and compiled HTML of a main text
ContentReferenceresource_key:identifier, a root named from outside the storage
LinkA content root (key, identifier, optional locale) or a Url of phil/url
SlugLowercase words joined by hyphens, at most 255 characters

Domain\Routing

ClassRole
RouteEntity of phil_content_route: one address, current or history
RouteIdUUIDv7 surrogate identifier of a route

Domain\Draft

ClassRole
WorkingCopyEntity of phil_content_working_copy: an author's autosave or a named draft of a content in a locale
WorkingCopyIdUUIDv7 identifier of a working copy

Domain\Contract

InterfaceKindRole
WorkingCopyRepositoryportAutosaves by author, named drafts by name, every working copy of a content

Domain\Repository

InterfaceKindRole
DimensionContentRepositoryportRows by dimension, by stage and version, the versions of a locale, latest versions
RouteRepositoryportRoutes by slug and by content, the current routes of many contents
ContentRootRepositoryportRoots by reference, references of roots
PublishedRowRepositoryportA page of the published rows of a kind in a locale
PublishedRowQuery, PublishedOrder, PublishedRowvalueWhat PublishedRowRepository reads, in which order, and each row found with its shared row

Domain\Exception

Every class implements Phil\DddBundle\Domain\Exception\DomainError.

ClassExtendsWhen
InvalidDimensionInvalidArgumentExceptionA malformed locale or one not served, the InvalidLocaleDimension of phil/locale-dimensions kept as previous; a row merged over one that is not its counterpart
InvalidContentInvalidArgumentExceptionA capability value, reference, slug, URL or link refused
ContentNotFoundRuntimeExceptionNo row, root, live content, autosave or named draft where one is needed
SlugTakenRuntimeExceptionThe slug is another root's current address
TransitionRefusedRuntimeExceptionThe workflow does not allow the operation

Application

ClassKindRole
ContentManagerimplementedThe PHP interface: create, edit, publish, unpublish, remove a draft, delete, read, list, status
ContentStatusimplementedWhere one locale of a root stands
Content\SingleKindsimplementedThe kinds that have a single content
Contract\CanonicalAddressesportThe absolute address of a content in a locale
Contract\PublicationScheduleportPublishing or taking offline at a set moment
Exception\PublicationLosesContentexceptionA publication refused for what its body would lose in UJO, with the losses
Editing\WorkingCopiesimplementedThe private autosave of each author and the named drafts of a content
Editing\AuthorRawHtmlimplementedThe raw HTML permission of the author of the revision being written: the user at work, or the author of the working copy being applied
Publication\PageEventsimplementedThe PagePublished and PageRetired events of phil/publishing, read from the live row
Publication\ContentArchive, Publication\ArchivedVersionimplemented, valueThe dated archive of a kind, and one publication in it
Publication\ScheduledPublicationvalueA transition planned for a moment
Content\ContentRootFactoryportBuilds a new root of a kind
Persistence\ContentTransactionportThe unit of work of an operation
Pipeline\DataMapper, Pipeline\Merger, Pipeline\NormalizerportsThe three pipeline stages
Pipeline\ContentDataMapperimplementedRuns every data mapper
Pipeline\ContentAggregatorimplementedMerges a localized row over its shared row, along a chain
Pipeline\ContentNormalizerimplementedRuns every normalizer, refuses a repeated key
DataMapper\TemplateDataMapper, SeoDataMapper, ExcerptDataMapper, LinkDataMapper, RoutableDataMapper, BodyDataMapperimplementedOne data mapper per capability (none for the workflow)
DataMapper\SubmittedDataimplementedTyped readers of submitted data
Contract\RawHtmlPermissionportWhether the user at work holds the trusted role: the bodies they write record it, show their raw HTML and keep it when published, by anyone
Merger\TemplateMerger, WorkflowMerger, SeoMerger, ExcerptMerger, LinkMerger, RoutableMerger, BodyMergerimplementedOne merger per capability
Normalizer\TemplateNormalizer, WorkflowNormalizer, SeoNormalizer, ExcerptNormalizer, LinkNormalizer, RoutableNormalizer, BodyNormalizerimplementedOne normalizer per capability
Editing\ContentEditorimplementedWrites submitted data onto the draft of a locale, forking and creating rows
Publication\ContentWorkflowimplementedThe symfony/workflow state machine
Publication\ContentPublisherimplementedPublish, unpublish, remove a draft; a published body in UJO
Publication\BodyConverterportThe body of a draft converted into the UJO a published row stores
Contract\ConversionLosses, Publication\ConversionLossport, valueWhat the conversion of a body into UJO does not keep
Publication\ContentVersionsimplementedLatest draft version, frozen versions, forks
Publication\DimensionContentCopierimplementedCopies a row to another dimension through the mergers
Publication\LiveContentReaderimplementedWhat a reader is served along a chain
Routing\RouteUpdaterimplementedSlug availability and current routes
Routing\RouteResolverimplementedA slug to a route to serve or redirect to
Routing\RouteMatchimplementedThe result of a resolution
Rendering\TemplateResolverimplementedTemplate key to Twig template

Infrastructure

Infrastructure\Doctrine

ClassRole
DoctrineDimensionContentRepositoryAdapter of DimensionContentRepository
DoctrineRouteRepositoryAdapter of RouteRepository
DoctrineContentRootRepositoryAdapter of ContentRootRepository
DoctrinePublishedRowRepositoryAdapter of PublishedRowRepository
RootIdentifiersA root's identifier from its string, and bound in an IN list as its DBAL type stores it
DoctrineContentTransactionAdapter of ContentTransaction
ConstructorContentRootFactoryAdapter of ContentRootFactory, constructor without arguments
ContentRootsThe declared root classes, their row classes and resource keys
DimensionContentMappingListenerloadClassMetadata: root association, unique dimension, capability columns
InvalidContentMappingLogicException for content classes that do not fit together
Mapping\CapabilityMappingAbstract base of the columns of one capability (extension point)
Mapping\TemplateCapabilityMapping, WorkflowCapabilityMapping, SeoCapabilityMapping, ExcerptCapabilityMapping, LinkCapabilityMapping, RoutableCapabilityMapping, BodyCapabilityMappingThe columns of each capability
DoctrineWorkingCopyRepositoryAdapter of WorkingCopyRepository
Type\LocaleType, StageType, VersionType, DimensionContentIdType, RouteIdType, WorkingCopyIdTypeThe DBAL types

Infrastructure\Http

ClassRole
ContentControllerServes live content by slug: 200, 301, 404
ContentUrlGeneratorThe URL of a root's current route
ResourceRoutesWhich Symfony routes serve each kind
ContentCanonicalAddressesAdapter of CanonicalAddresses over the router
ArchiveControllerServes one dated version of a content of an archived kind
ContentAdminControllerThe administration: list, creation, editing page, autosave
FeedController, PreviewController, PreviewLinksAtom feeds, previews of drafts and their signed links

Infrastructure\EasyAdmin

ClassRole
ContentAdminThe menu item of an EasyAdmin dashboard that links to the administration

Infrastructure\Scheduling

ClassRole
ScheduledTransitionsPublicationScheduleAdapter of PublicationSchedule over phil/scheduled-transitions-bundle
PublicationReferencesA publication named news:42@fr for that bundle, and read back
PublicationSubjectsThe resolver that bundle's workflow handler finds the publications by
ClassRole
ContentDocumentProviderThe DocumentProvider of phil/search-bundle that feeds it the live rows

Infrastructure\Markup

ClassRole
Markup\MarkupServicesRegisters the default adapters of phil/markup and the bundle's converter, and aliases the three ports to them
Markup\UjoBodyConverterAdapter of BodyConverter and ConversionLosses: phil/markup's readers, phil/ujo's encoder, compiled and purified
Markup\RawHtmlRoleAdapter of RawHtmlPermission: the trusted role of raw_html_role, checked by Symfony's authorization checker
Markup\RawHtmlAuthorPassCompiler pass: with a RawHtmlPermission, wraps it in AuthorRawHtml for BodyDataMapper and WorkingCopies, and tells UjoBodyConverter that raw HTML is configured

Infrastructure\Twig

ClassRole
ContentExtensionDeclares the seven Twig functions
ContentRuntimeImplements them, built lazily

Infrastructure\Console

ClassRole
ContentCommandAbstract base: data options, DomainError as an error message
CreateContentCommand, EditContentCommand, PublishContentCommand, UnpublishContentCommand, ListContentCommandphil:content:create, edit, publish, unpublish, list
SubmittedFieldsReads --file, --field and --json

ContentManager::removeDraft() and ContentManager::delete() have no console command; they are called from PHP or, for the first, from the administration.