Read from the package's own PHP files at the commit c71090111a35: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
GalleryBundleclassAlbums of photographs on top of omnibase's Thread. An Album IS a Thread (JOINED subclass): one album is one creation, its Photos are ordered.
3 methods
OpenToAdminsTraittraitThis bundle's screens are written by the site's administrators (ROLE_ADMIN: a teacher, an editor), not only by the super-admin the admin bundle requires by default for anything that writes - as omnibase/estate does. $custom names the screen's own actions (#[AdminAction]).
Base\Gallery\Controller\Admin\Crud
AlbumCrudControllerclassAn album in the back office: its title, the day the work was made, the preview shown on the list, its text, its tags and taxa, and its photographs - each with its place, saved in that order. Two buttons: "Publier" (or back to draft) and "À la une".
13 methods
PhotoCrudControllerclassEvery photograph of every album, album by album and in order: to find one, fix a caption or a credit without opening its album. A photograph is added from its album's screen as well.
6 methods
Base\Gallery\Controller\Client
GalleryControllerclassThe gallery: every published album a page at a time, filtered by a tag (?tag=); one page per taxon (/galerie/{taxon}: the albums it classifies, with its label and description); one page per album, its photographs in order. The first segment is gallery.path ("galerie" by default).
3 methods
Base\Gallery\DependencyInjection
GalleryConfigurationclass1 method
GalleryExtensionclass2 methods
AlbumclassAn album: one creation, shown by its photographs. An omnibase thread - title, excerpt and text translated, slug, publication state and date, tags (free words that filter the list), taxa (what the site classifies with: each may have its own page) - with the day the work was made, a "featured" flag and its photographs in order on top.
17 methods
PhotoclassA photograph of an album: the file, the words under it (caption), the words a screen reader says (alt), who took it (credit), its place in the album, whether it is the album's cover, and a free label - "Avant", "Après", "Détail" - that a site may show on it or group by.
24 methods
SitemapListenerclassThe albums' and the taxa's own pages in /sitemap.xml: omnibase lists the routes it can generate by itself (the gallery's first page), and these are behind a slug it cannot know. Each album carries the day it was last changed, so a crawler comes back to the ones that move.
2 methods
PhotoTypeclassOne photograph of an album in the back office: the picture, its place, its caption, what a screen reader says, the credit, a free label and whether it is the cover.
2 methods
AlbumRepositoryclassThe published albums. Every query is on Album: with JOINED inheritance an application's subclass comes back as itself, so the pages and the Twig function need no other repository. A subclass's own repository extends this one and passes its class. (INSTANCE OF takes the class's name, not its discriminator as a parameter: the name covers the subclasses.)
11 methods
PhotoRepositoryclass1 method
JsonLdclassAn album as schema.org reads it: an ImageGallery whose images are ImageObjects, each with its address, its caption and its credit.
2 methods
GalleryExtensionclassWhat a host's own pages ask the gallery: a few albums for a home page or a family's page, the taxa for a menu.
2 methods
Base\Gallery
GalleryBundle class
class GalleryBundle extends AbstractBaseBundle GalleryBundle.php:14
Albums of photographs on top of omnibase's Thread. An Album IS a Thread (JOINED subclass): one album is one creation, its Photos are ordered.
Nothing else: no follow-up of the work (that is omnibase/forge), no trade.
GalleryBundle::__construct()
public function __construct()GalleryBundle::getPath()
public function getPath(): stringModern layout: the class lives in src/, the bundle root is the package root.
GalleryBundle::build()
public function build(ContainerBuilder $container): voidBase\Gallery\Controller\Admin
OpenToAdminsTrait trait
trait OpenToAdminsTrait OpenToAdminsTrait.php:14
This bundle's screens are written by the site's administrators (ROLE_ADMIN: a teacher, an editor), not only by the super-admin the admin bundle requires by default for anything that writes - as omnibase/estate does. $custom names the screen's own actions (#[AdminAction]).
Base\Gallery\Controller\Admin\Crud
AlbumCrudController class
class AlbumCrudController extends AbstractCrudController AlbumCrudController.php:40
An album in the back office: its title, the day the work was made, the preview shown on the list, its text, its tags and taxa, and its photographs - each with its place, saved in that order. Two buttons: "Publier" (or back to draft) and "À la une".
An application's subclass of Album has its own screen by extending this one: getEntityFqcn() returns its class, configureFields() yields parent's fields and its own (docs/extending.md).
AlbumCrudController::setTaxonClass()
public function setTaxonClass(string $taxonClass = Taxon::class): voidAlbumCrudController::getEntityFqcn()
public static function getEntityFqcn(): stringAlbumCrudController::getPreferredIcon()
public static function getPreferredIcon(): ?stringAlbumCrudController::configureFilters()
public function configureFilters(Filters $filters): FiltersAlbumCrudController::configureActions()
public function configureActions(Actions $actions): ActionsAlbumCrudController::configureFields()
public function configureFields(string $pageName): iterableAlbumCrudController::createEntity()
public function createEntity(string $entityFqcn): objectAlbumCrudController::persistEntity()
public function persistEntity(EntityManagerInterface $entityManager, object $entity): voidSaved in the order typed: the places rewritten 1, 2, 3..., one cover at most.
AlbumCrudController::updateEntity()
public function updateEntity(EntityManagerInterface $entityManager, object $entity): voidAlbumCrudController::publish()
public function publish(string $entityId): ResponseAlbumCrudController::unpublish()
public function unpublish(string $entityId): ResponseAlbumCrudController::feature()
public function feature(string $entityId): ResponseAlbumCrudController::unfeature()
public function unfeature(string $entityId): ResponsePhotoCrudController class
class PhotoCrudController extends AbstractCrudController PhotoCrudController.php:25
Every photograph of every album, album by album and in order: to find one, fix a caption or a credit without opening its album. A photograph is added from its album's screen as well.
PhotoCrudController::getEntityFqcn()
public static function getEntityFqcn(): stringPhotoCrudController::getPreferredIcon()
public static function getPreferredIcon(): ?stringPhotoCrudController::configureCrud()
public function configureCrud(Crud $crud): CrudPhotoCrudController::configureFilters()
public function configureFilters(Filters $filters): FiltersPhotoCrudController::configureActions()
public function configureActions(Actions $actions): ActionsPhotoCrudController::configureFields()
public function configureFields(string $pageName): iterableBase\Gallery\Controller\Client
GalleryController class
class GalleryController extends AbstractController GalleryController.php:27
The gallery: every published album a page at a time, filtered by a tag (?tag=); one page per taxon (/galerie/{taxon}: the albums it classifies, with its label and description); one page per album, its photographs in order. The first segment is gallery.path ("galerie" by default).
A taxon's page and an album's page share one pattern, /{path}/{slug}: the taxon is looked for first - they are few, and an album never takes a taxon's slug knowingly.
GalleryController::__construct()
public function __construct(readonly AlbumRepository $albums, readonly JsonLd $jsonLd, readonly int $perPage = 24, readonly string $taxonClass = Taxon::class)GalleryController::index()
public function index(Request $request): ResponseGalleryController::show()
public function show(Request $request, string $slug): ResponseBase\Gallery\DependencyInjection
GalleryConfiguration class
class GalleryConfiguration extends AbstractBaseConfiguration GalleryConfiguration.php:9
GalleryConfiguration::getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilderGalleryExtension class
class GalleryExtension extends AbstractBaseExtension GalleryExtension.php:11
GalleryExtension::getConfiguration()
public function getConfiguration(array $config, ContainerBuilder $container): GalleryConfigurationGalleryExtension::load()
public function load(array $configs, ContainerBuilder $container): voidBase\Gallery\Entity
Album class
class Album extends Thread implements LinkableInterface Album.php:27
An album: one creation, shown by its photographs. An omnibase thread - title, excerpt and text translated, slug, publication state and date, tags (free words that filter the list), taxa (what the site classifies with: each may have its own page) - with the day the work was made, a "featured" flag and its photographs in order on top.
Written to be extended: an application that needs more (a customer, a town, a technical sheet) declares a JOINED subclass with its own #[DiscriminatorEntry]; the repository, the pages, the Twig function and the back office work on it as they are (docs/extending.md).
Album::__iconizeStatic()
public static function __iconizeStatic(): ?arrayAlbum::__toLink()
public function __toLink(array $routeParameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): ?stringAlbum::__construct()
public function __construct(?\Base\Entity\User $owner = null, ?Thread $parent = null, ?string $title = null, ?string $slug = null)Album::__toString()
public function __toString(): stringAlbum::getMadeAt()
public function getMadeAt(): ?\DateTimeInterfaceAlbum::setMadeAt()
public function setMadeAt(?\DateTimeInterface $madeAt): selfAlbum::isFeatured()
public function isFeatured(): boolAlbum::setFeatured()
public function setFeatured(bool $featured): selfAlbum::getPhotos()
public function getPhotos(): Collection- Returns
as stored; getOrderedPhotos() for the order shown
Album::addPhoto()
public function addPhoto(Photo $photo): selfAlbum::removePhoto()
public function removePhoto(Photo $photo): selfAlbum::getOrderedPhotos()
public function getOrderedPhotos(): arrayThe photographs in the order they are shown: by position, then in the order they were added - also right after one was added or moved, before the database has sorted them.
Album::getCover()
public function getCover(): ?PhotoThe photograph on the album's card and at the top of its page: the one marked, else the first.
Album::setCover()
public function setCover(?Photo $cover): selfOne cover at most: marking a photograph unmarks the others.
Album::getPhotosByLabel()
public function getPhotosByLabel(): arrayThe photographs carrying a label ("Avant", "Après"), by label, in order.
@return array<string, list<Photo>>
Album::renumberPhotos()
public function renumberPhotos(): selfThe positions rewritten 1, 2, 3... in the order shown (after a photograph was removed or moved).
Album::publish()
public function publish(bool $published = true, ?\DateTimeInterface $at = null): selfPublish it now (or at $at), or take it back to draft.
Photo class
class Photo Photo.php:16
A photograph of an album: the file, the words under it (caption), the words a screen reader says (alt), who took it (credit), its place in the album, whether it is the album's cover, and a free label - "Avant", "Après", "Détail" - that a site may show on it or group by.
Photo::__toString()
public function __toString(): stringPhoto::getId()
public function getId(): ?intPhoto::getAlbum()
public function getAlbum(): ?AlbumPhoto::setAlbum()
public function setAlbum(?Album $album): selfPhoto::getFile()
public function getFile(): ?stringWhere the storage keeps the picture (what omnibase's |picture, |thumbnail and |lightbox take).
Photo::setFile()
public function setFile($file): selfPhoto::hasFile()
public function hasFile(): boolWhether a picture is set, without asking the storage where it is.
Photo::getFileUrl()
public function getFileUrl(): ?stringThe picture's address on the site ("/uploads/…"), what an <img> or a JSON-LD ImageObject takes: the storage gives its public path from the server's root, the public directory is taken off.
Photo::publicUrl()
public static function publicUrl(?string $path): ?string"/srv/app/public/uploads/a.jpg" → "/uploads/a.jpg"; a URL or a site path as it is.
Photo::getCaption()
public function getCaption(): ?stringPhoto::setCaption()
public function setCaption(?string $caption): selfPhoto::getAlt()
public function getAlt(): stringWhat a screen reader says: the alt typed, else the caption, else the album's title.
Photo::getOwnAlt()
public function getOwnAlt(): ?stringThe alt as typed (the form's value): null when none was.
Photo::setOwnAlt()
public function setOwnAlt(?string $alt): selfPhoto::setAlt()
public function setAlt(?string $alt): selfPhoto::getCredit()
public function getCredit(): ?stringPhoto::setCredit()
public function setCredit(?string $credit): selfPhoto::getCreditLine()
public function getCreditLine(): ?stringThe credit with its sign: "Anna Meyer" is printed "© Anna Meyer".
Photo::getPosition()
public function getPosition(): ?intPhoto::setPosition()
public function setPosition(?int $position): selfPhoto::isCover()
public function isCover(): boolPhoto::setCover()
public function setCover(bool $cover): selfPhoto::getLabel()
public function getLabel(): ?stringPhoto::setLabel()
public function setLabel(?string $label): selfBase\Gallery\EventListener
SitemapListener class
final class SitemapListener SitemapListener.php:17
The albums' and the taxa's own pages in /sitemap.xml: omnibase lists the routes it can generate by itself (the gallery's first page), and these are behind a slug it cannot know. Each album carries the day it was last changed, so a crawler comes back to the ones that move.
SitemapListener::__construct()
public function __construct(readonly AlbumRepository $albums, readonly string $taxonClass = Taxon::class, readonly bool $enabled = true)SitemapListener::__invoke()
public function __invoke(SitemapEvent $event): voidBase\Gallery\Form
PhotoType class
class PhotoType extends AbstractType PhotoType.php:22
One photograph of an album in the back office: the picture, its place, its caption, what a screen reader says, the credit, a free label and whether it is the cover.
The texts name their domain (@gallery.…): omnibase gives every field the "fields" domain, which the form's own translation_domain does not reach.
PhotoType::buildForm()
public function buildForm(FormBuilderInterface $builder, array $options): voidPhotoType::configureOptions()
public function configureOptions(OptionsResolver $resolver): voidBase\Gallery\Repository
AlbumRepository class
class AlbumRepository extends ServiceEntityRepository AlbumRepository.php:22
The published albums. Every query is on Album: with JOINED inheritance an application's subclass comes back as itself, so the pages and the Twig function need no other repository. A subclass's own repository extends this one and passes its class. (INSTANCE OF takes the class's name, not its discriminator as a parameter: the name covers the subclasses.)
AlbumRepository::__construct()
public function __construct(ManagerRegistry $registry, string $entityClass = Album::class)AlbumRepository::findPublishedPage()
public function findPublishedPage(int $page = 1, int $perPage = 24, ?string $taxon = null, ?string $tag = null, ?bool $featured = null): arrayA page of the published albums - the featured ones first, then the most recent work (madeAt, else the publication date) - of one taxon and/or one tag when their slugs are given. Paged by hand: Doctrine's Paginator walks the SQL with an output walker omnibase's own SqlWalker is incompatible with.
AlbumRepository::countPublished()
public function countPublished(?string $taxon = null, ?string $tag = null, ?bool $featured = null): intAlbumRepository::findLatest()
public function findLatest(int $limit = 6, ?bool $featured = null, ?string $taxon = null): arrayAlbumRepository::findAllPublished()
public function findAllPublished(): array- Returns
every published album, for a sitemap
AlbumRepository::findOnePublished()
public function findOnePublished(string $slug): ?AlbumAlbumRepository::findNeighbours()
public function findNeighbours(Album $album): array- Returns
the one before and the one after in the list's order
AlbumRepository::neighbours()
public static function neighbours(array $ids, int $id, callable $load): arrayThe ids before and after $id in $ids, each turned into its album.
AlbumRepository::findTags()
public function findTags(?string $taxon = null): array- Returns
the tags of the published albums (of one taxon when given): the list's filters
AlbumRepository::findTaxa()
public function findTaxa(string $class = Taxon::class): arrayThe taxa that have a page: of $class (omnibase's Taxon and its
subclasses by default). With the default class, only those that
classify a published album; with an application's class, all of them -
by their position when the class has that field.
AlbumRepository::findTaxon()
public function findTaxon(string $slug, string $class = Taxon::class): ?TaxonPhotoRepository class
class PhotoRepository extends ServiceEntityRepository PhotoRepository.php:10
PhotoRepository::__construct()
public function __construct(ManagerRegistry $registry)Base\Gallery\Service
JsonLd class
final class JsonLd JsonLd.php:13
An album as schema.org reads it: an ImageGallery whose images are ImageObjects, each with its address, its caption and its credit.
Plain arrays: the template encodes them.
JsonLd::album()
public function album(Album $album, string $url, ?callable $absolute = null): array$urlthe album's absolute address
$absoluteturns a picture's site path ("/uploads/a.jpg") into an absolute address; null leaves the paths as they are
JsonLd::photo()
public function photo(Photo $photo, ?callable $absolute = null): ?array- Returns
null for a photograph without a file
Base\Gallery\Twig
GalleryExtension class
final class GalleryExtension extends AbstractExtension GalleryExtension.php:12
What a host's own pages ask the gallery: a few albums for a home page or a family's page, the taxa for a menu.
GalleryExtension::__construct()
public function __construct(readonly AlbumRepository $albums, readonly string $taxonClass = Taxon::class)GalleryExtension::getFunctions()
public function getFunctions(): array