Read from the package's own PHP files at the commit 6c35618e0ddc: 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.
PressBundleclassThe press kit an artist's agency asks for: what was written about them (Quote), the pictures a programme may print (Photo), the biography in three lengths (Bio) - one page, /press, and three Twig functions.
3 methods
Base\Press\Controller\Admin\Crud
BioCrudControllerclassWriting the biographies: one per language and per length. Plain text, a blank line between two paragraphs; the words are counted as they are typed, against what the length is meant to hold (100, 250).
5 methods
PhotoCrudControllerclassThe press pictures: the original as the photographer delivered it, the credit to print with it, a caption, whether it may be downloaded, and where it is shown: the press kit (/press), the site's gallery, or both.
4 methods
QuoteCrudControllerclassFiling what was said: the words, who said them and where, what about.
8 methods
PressControllerclassThe press page: what was written (the featured quotes), the biography in the reader's language - each length with its "copy" button -, the pictures with their credit and, when allowed, their original to download, and who to write to.
3 methods · 1 constant
Base\Press\DependencyInjection
PressConfigurationclass1 method
PressExtensionclass2 methods
BioclassThe biography, once per language and per length: the short one of a season brochure, the medium one of a programme note, the full one. Plain text, a blank line between two paragraphs - it is copied into a programme, not laid out here. The date it was last touched is shown with it: an agency wants to know the biography it prints is the current one.
15 methods
PhotoclassA picture of the artist: the file as the photographer delivered it (up to 64 MB, a programme prints it), who took it - the credit a paper must print with it -, a caption, and where it is shown: in the press kit (/press, "visible"; its original downloadable or not), in the site's own gallery ("gallery", press_gallery()), or both.
22 methods
QuoteclassWhat was said or written: the words, who said them ("Joshua Bell", "violinist"), where ("BBC Music Magazine", with its link and date), and what about (the album, the concert - a free reference, no relation).
43 methods
BioLengthenumThe three biographies a presenter asks for: the one of a season brochure (about 100 words), the one of a programme note (about 250), the full one.
1 method · 3 cases
QuoteKindenumWho speaks: a paper or a magazine, a colleague (a conductor, a fellow soloist), someone in the hall. A string enum (not omnibase's EnumType) so the column reads plainly in the database and in the admin's filters.
3 cases
BioRepositoryclass3 methods
PhotoRepositoryclass3 methods
QuoteRepositoryclass3 methods
PhotoFilenameclassThe name a downloaded picture is saved under: "<site>-<slug>.<ext>" - "clara-weiss-portrait-with-harp.jpg" -, so the file in a journalist's downloads folder still says whose it is. The slug is the picture's title, else its credit, else its number.
1 method
PressExtensionclassWhat a host's own pages ask the press kit: a few quotes for a home page (the featured ones first), the biography of one length for an "about" page, the press kit's pictures, the site's gallery, who to write to (press.contacts) for a contact page.
2 methods
Base\Press
PressBundle class
class PressBundle extends AbstractBaseBundle PressBundle.php:14
The press kit an artist's agency asks for: what was written about them (Quote), the pictures a programme may print (Photo), the biography in three lengths (Bio) - one page, /press, and three Twig functions.
PressBundle::__construct()
public function __construct()PressBundle::getPath()
public function getPath(): stringModern layout: the class lives in src/, the bundle root is the package root.
PressBundle::build()
public function build(ContainerBuilder $container): voidBase\Press\Controller\Admin\Crud
BioCrudController class
class BioCrudController extends AbstractCrudController BioCrudController.php:23
Writing the biographies: one per language and per length. Plain text, a blank line between two paragraphs; the words are counted as they are typed, against what the length is meant to hold (100, 250).
BioCrudController::setPressLocales()
public function setPressLocales(array $locales = []): voidThe site's languages (framework.enabled_locales), when it declares them.
BioCrudController::getEntityFqcn()
public static function getEntityFqcn(): stringBioCrudController::getPreferredIcon()
public static function getPreferredIcon(): ?stringBioCrudController::configureFilters()
public function configureFilters(Filters $filters): FiltersBioCrudController::configureFields()
public function configureFields(string $pageName): iterablePhotoCrudController class
class PhotoCrudController extends AbstractCrudController PhotoCrudController.php:21
The press pictures: the original as the photographer delivered it, the credit to print with it, a caption, whether it may be downloaded, and where it is shown: the press kit (/press), the site's gallery, or both.
PhotoCrudController::getEntityFqcn()
public static function getEntityFqcn(): stringPhotoCrudController::getPreferredIcon()
public static function getPreferredIcon(): ?stringPhotoCrudController::configureFilters()
public function configureFilters(Filters $filters): FiltersPhotoCrudController::configureFields()
public function configureFields(string $pageName): iterableQuoteCrudController class
class QuoteCrudController extends AbstractCrudController QuoteCrudController.php:30
Filing what was said: the words, who said them and where, what about.
One button on each - "feature" - puts a quote among the few a home page shows, or takes it back.
QuoteCrudController::setPressLocales()
public function setPressLocales(array $locales = []): voidThe site's languages (framework.enabled_locales), when it declares them.
QuoteCrudController::setPressTranslator()
public function setPressTranslator(TranslatorInterface $translator): voidQuoteCrudController::getEntityFqcn()
public static function getEntityFqcn(): stringQuoteCrudController::getPreferredIcon()
public static function getPreferredIcon(): ?stringQuoteCrudController::configureFilters()
public function configureFilters(Filters $filters): FiltersQuoteCrudController::configureFields()
public function configureFields(string $pageName): iterableQuoteCrudController::configureActions()
public function configureActions(Actions $actions): ActionsQuoteCrudController::feature()
public function feature(string $entityId): ResponseBase\Press\Controller\Client
PressController class
class PressController extends AbstractController PressController.php:25
The press page: what was written (the featured quotes), the biography in the reader's language - each length with its "copy" button -, the pictures with their credit and, when allowed, their original to download, and who to write to.
const FALLBACK_LOCALE = 'en'The language shown when the reader's has nothing: the one every agency reads.
PressController::__construct()
public function __construct(readonly QuoteRepository $quotes, readonly BioRepository $bios, readonly PhotoRepository $photos, readonly SettingBagInterface $settings, readonly array $contacts = [], readonly bool $downloadKit = true, readonly array $bioLengths = ['short', 'medium', 'long'])PressController::index()
public function index(Request $request): ResponsePressController::download()
public function download(Request $request, int $id): ResponseThe original, as the photographer delivered it, under a name that says whose it is.
Base\Press\DependencyInjection
PressConfiguration class
class PressConfiguration extends AbstractBaseConfiguration PressConfiguration.php:8
PressConfiguration::getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilderPressExtension class
class PressExtension extends AbstractBaseExtension PressExtension.php:11
PressExtension::getConfiguration()
public function getConfiguration(array $config, ContainerBuilder $container): PressConfigurationPressExtension::load()
public function load(array $configs, ContainerBuilder $container): voidBase\Press\Entity
Bio class
class Bio Bio.php:19
The biography, once per language and per length: the short one of a season brochure, the medium one of a programme note, the full one. Plain text, a blank line between two paragraphs - it is copied into a programme, not laid out here. The date it was last touched is shown with it: an agency wants to know the biography it prints is the current one.
Bio::__construct()
public function __construct(string $locale = 'en', BioLength $length = BioLength::SHORT, ?string $content = null)Bio::__toString()
public function __toString(): stringBio::getId()
public function getId(): ?intBio::getLocale()
public function getLocale(): stringBio::setLocale()
public function setLocale(?string $locale): selfBio::getLength()
public function getLength(): BioLengthBio::setLength()
public function setLength(BioLength|string $length): selfBio::getContent()
public function getContent(): ?stringBio::setContent()
public function setContent(?string $content): selfBio::getUpdatedAt()
public function getUpdatedAt(): ?\DateTimeInterfaceBio::setUpdatedAt()
public function setUpdatedAt(?\DateTimeInterface $updatedAt): selfBio::getParagraphs()
public function getParagraphs(): array- Returns
the paragraphs: what a blank line separates
Bio::getWordCount()
public function getWordCount(): intBio::isTooLong()
public function isTooLong(): boolMore words than its length is meant to hold (ten percent are forgiven); the full one never is.
Bio::countWords()
public static function countWords(string $text): intThe words of a text, the way a programme editor counts them: what stands between two blanks, in any alphabet - "l'archet" and "Sinfonie-Orchester" are one word each, a lone dash is none.
Photo class
class Photo Photo.php:18
A picture of the artist: the file as the photographer delivered it (up to 64 MB, a programme prints it), who took it - the credit a paper must print with it -, a caption, and where it is shown: in the press kit (/press, "visible"; its original downloadable or not), in the site's own gallery ("gallery", press_gallery()), or both.
Photo::__toString()
public function __toString(): stringPhoto::getId()
public function getId(): ?intPhoto::getFile()
public function getFile(): ?stringPhoto::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> takes: the storage gives its public path from the server's root ("/srv/app/public/uploads/…"), the public directory is taken off.
Photo::getAlt()
public function getAlt(): stringWhat a screen reader says of the picture: its caption, else its title.
Photo::getTitle()
public function getTitle(): ?stringPhoto::setTitle()
public function setTitle(?string $title): selfPhoto::getCredit()
public function getCredit(): ?stringPhoto::setCredit()
public function setCredit(?string $credit): selfPhoto::getCreditLine()
public function getCreditLine(): ?stringThe credit with its sign: "Harald Hoffmann" is printed "© Harald Hoffmann".
Photo::getCaption()
public function getCaption(): ?stringPhoto::setCaption()
public function setCaption(?string $caption): selfPhoto::isDownloadable()
public function isDownloadable(): boolPhoto::setDownloadable()
public function setDownloadable(bool $downloadable): selfPhoto::getPosition()
public function getPosition(): intPhoto::setPosition()
public function setPosition(?int $position): selfPhoto::isVisible()
public function isVisible(): boolPhoto::setVisible()
public function setVisible(bool $visible): selfPhoto::isGallery()
public function isGallery(): boolPhoto::setGallery()
public function setGallery(bool $gallery): selfQuote class
class Quote Quote.php:22
What was said or written: the words, who said them ("Joshua Bell", "violinist"), where ("BBC Music Magazine", with its link and date), and what about (the album, the concert - a free reference, no relation).
The words are kept as they were said or written (language says in which
tongue), with their translations beside them (translations: per
language, the words and the speaker's quality): a reader sees the words in
their own language when there is a translation, and may ask for the
original (offerOriginal). locale only restricts a quote to the readers
of one language (empty: shown to all).
Quote::__construct()
public function __construct(?string $text = null, ?string $author = null, ?string $source = null)Quote::__toString()
public function __toString(): stringQuote::getId()
public function getId(): ?intQuote::getText()
public function getText(): ?stringQuote::setText()
public function setText(?string $text): selfQuote::getLocale()
public function getLocale(): ?stringQuote::setLocale()
public function setLocale(?string $locale): selfQuote::getAuthor()
public function getAuthor(): ?stringQuote::setAuthor()
public function setAuthor(?string $author): selfQuote::getRole()
public function getRole(): ?stringQuote::setRole()
public function setRole(?string $role): selfQuote::getSource()
public function getSource(): ?stringQuote::setSource()
public function setSource(?string $source): selfQuote::getUrl()
public function getUrl(): ?stringQuote::setUrl()
public function setUrl(?string $url): selfQuote::getDate()
public function getDate(): ?\DateTimeImmutableQuote::setDate()
public function setDate(?\DateTimeInterface $date): selfQuote::getKind()
public function getKind(): QuoteKindQuote::setKind()
public function setKind(QuoteKind|string $kind): selfQuote::isFeatured()
public function isFeatured(): boolQuote::setFeatured()
public function setFeatured(bool $featured): selfQuote::toggleFeatured()
public function toggleFeatured(): selfThe back office's button: featured, or no longer.
Quote::getPosition()
public function getPosition(): intQuote::setPosition()
public function setPosition(?int $position): selfQuote::getRelease()
public function getRelease(): ?stringQuote::setRelease()
public function setRelease(?string $release): selfQuote::isVisible()
public function isVisible(): boolQuote::setVisible()
public function setVisible(bool $visible): selfQuote::getLanguage()
public function getLanguage(): ?stringQuote::setLanguage()
public function setLanguage(?string $language): selfQuote::isOfferOriginal()
public function isOfferOriginal(): boolQuote::setOfferOriginal()
public function setOfferOriginal(bool $offer): selfQuote::getTranslations()
public function getTranslations(): arrayQuote::setTranslations()
public function setTranslations(?array $translations): self$translationsa bare string is the words
Quote::setTranslation()
public function setTranslation(string $locale, ?string $text, ?string $role = null): selfThe words (and, when given, the speaker's quality) in one language; nothing of either removes it.
Quote::isTranslatedIn()
public function isTranslatedIn(string $locale): boolWhether a reader of $locale reads a translation (there is one, and it is not the original's language).
Quote::getTextIn()
public function getTextIn(string $locale): ?stringThe words for a reader of $locale: the translation, else the original.
Quote::getRoleIn()
public function getRoleIn(string $locale): ?stringThe speaker's quality for a reader of $locale ("chef d'orchestre"), else as typed.
Quote::__isset()
public function __isset(string $name): boolThe back office's fields, one pair per language of the site:
translation_fr (the words) and role_fr (the quality) read and write
translations.
Quote::__get()
public function __get(string $name): ?stringQuote::__set()
public function __set(string $name, mixed $value): voidQuote::speaks()
public function speaks(string $locale): boolShown to a reader of $locale: written in it, or in no language in particular.
Quote::getSignature()
public function getSignature(): stringThe line under the words: "Joshua Bell, violinist" or, with only the paper, "BBC Music Magazine". The source is not repeated when the role already names it.
Base\Press\Enum
BioLength enum
enum BioLength BioLength.php:9
The three biographies a presenter asks for: the one of a season brochure (about 100 words), the one of a programme note (about 250), the full one.
case SHORT = 'short'case MEDIUM = 'medium'case LONG = 'long'
BioLength::words()
public function words(): ?intThe words it is expected to hold; null: as long as it needs.
QuoteKind enum
enum QuoteKind QuoteKind.php:10
Who speaks: a paper or a magazine, a colleague (a conductor, a fellow soloist), someone in the hall. A string enum (not omnibase's EnumType) so the column reads plainly in the database and in the admin's filters.
case PRESS = 'press'case COLLEAGUE = 'colleague'case AUDIENCE = 'audience'
Base\Press\Repository
BioRepository class
class BioRepository extends ServiceEntityRepository BioRepository.php:11
BioRepository::__construct()
public function __construct(ManagerRegistry $registry)BioRepository::findOneFor()
public function findOneFor(BioLength $length, string $locale, string $fallback = 'en'): ?BioThe biography of one length in $locale, else in the fallback language.
BioRepository::findByLength()
public function findByLength(string $locale, array $lengths = ['short', 'medium', 'long'], string $fallback = 'en'): arrayThe biographies of a page, by length, each in $locale or else in the fallback language; a length nobody wrote is left out.
$lengthsthe lengths wanted, in order ('short', 'medium', 'long')
- Returns
length => biography
PhotoRepository class
class PhotoRepository extends ServiceEntityRepository PhotoRepository.php:10
PhotoRepository::__construct()
public function __construct(ManagerRegistry $registry)PhotoRepository::findVisible()
public function findVisible(?int $limit = null): array- Returns
the pictures shown, in their order
PhotoRepository::findGallery()
public function findGallery(?int $limit = null): array- Returns
the pictures of the site's own gallery, in their order
QuoteRepository class
class QuoteRepository extends ServiceEntityRepository QuoteRepository.php:11
QuoteRepository::__construct()
public function __construct(ManagerRegistry $registry)QuoteRepository::findVisible()
public function findVisible(?string $locale = null, ?QuoteKind $kind = null, ?int $limit = null, bool $featuredOnly = false): arrayThe quotes shown to a reader of $locale - written in it, or in no language in particular -, the featured ones first, then in their order, the newest first among equals. No locale: every language.
QuoteRepository::findForLocale()
public function findForLocale(string $locale, string $fallback = 'en', ?QuoteKind $kind = null, ?int $limit = null, bool $featuredOnly = false): arrayThe same, falling back on another language (English) when the reader's has nothing: a German page with no German quote shows the English ones rather than none.
Base\Press\Service
PhotoFilename class
final class PhotoFilename PhotoFilename.php:13
The name a downloaded picture is saved under: "<site>-<slug>.<ext>" - "clara-weiss-portrait-with-harp.jpg" -, so the file in a journalist's downloads folder still says whose it is. The slug is the picture's title, else its credit, else its number.
PhotoFilename::of()
public static function of(?string $site, ?string $title, ?string $credit, ?int $id, ?string $extension): stringBase\Press\Twig
PressExtension class
final class PressExtension extends AbstractExtension PressExtension.php:22
What a host's own pages ask the press kit: a few quotes for a home page (the featured ones first), the biography of one length for an "about" page, the press kit's pictures, the site's gallery, who to write to (press.contacts) for a contact page.
PressExtension::__construct()
public function __construct(readonly QuoteRepository $quotes, readonly BioRepository $bios, readonly PhotoRepository $photos, readonly RequestStack $requests, readonly array $contacts = [])PressExtension::getFunctions()
public function getFunctions(): array