Aller au contenu

omnibase/classroom Référence de l’API

Étage
Structure préparée · Omnibase
Version
main
Vérifié en réel
Son README ne le dit pas
Licence
MIT
composer require omnibase/classroom:dev-main

Lue dans les fichiers PHP du paquet au commit a5af4be92fff : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Base\Classroom

  • ClassroomBundle class

    The open classroom: levels, subjects, sequences, cards and resources on omnibase's Thread and Taxon.

    3 methods

Base\Classroom\Admin\Widget

  • ClassroomOverviewWidgetType class

    The classroom at a glance: sequences online and in draft, cards, resources, downloads, what was bought this month.

    4 methods

Base\Classroom\Controller\Admin

  • OpenToAdminsTrait trait

    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\Classroom\Controller\Admin\Crud

  • CardCrudController class

    The idea cards: a picture, a title, a line, a few paragraphs, up to three links, levels and subjects.

    6 methods

  • LevelCrudController class

    The levels: omnibase's taxon screen, plus what a level adds.

    3 methods

  • PurposeCrudController class

    The purposes: omnibase's taxon screen, plus what a purpose adds.

    3 methods

  • ResourceCrudController class

    The resources: the file (on the private storage), its saved name, who it is for, its preview picture, its levels and subjects. "Mettre en vente" creates the shop's offer for a paid one in one click (omnibase/marketplace).

    8 methods

  • ResourceOfferCrudController class

    The resources for sale: the shop's product screen, plus the resource delivered.

    3 methods

  • SequenceCrudController class

    Writing a sequence: title, levels, subjects, purposes, period, duration, objectives and competences (one per line), material, the presentation (EditorJS, autosaved - and co-edited live when the relay runs), the resources attached, the cover. Its sessions have their own screen.

    6 methods

  • SessionCrudController class

    The sessions: which sequence, which place, how long, the aim, the course.

    6 methods

  • SubjectCrudController class

    The subjects: omnibase's taxon screen, plus what a subject adds.

    3 methods

Base\Classroom\Controller\Client

  • ClassroomController class

    The classroom read by level, by subject, by purpose - the way a colleague looks for things: "CP › Allemand", "Multi-niveaux › Arts", "Pour la classe › Rituels" - each page listing the sequences, the cards and the resources that match, in the chronicle's order (newest first), by period when asked. Then the sequences, the cards, the resources on their own, and a search across all three.

    11 methods

  • ResourceController class

    A resource's page - its preview (a picture, or the first rows of a spreadsheet), its levels and subjects, the sequences it belongs to, the offer when it is for sale - and its download in two steps: the button checks who you are (ResourceVoter) and redirects to a signed, short-lived file URL, served by nginx (X-Accel-Redirect to classroom.accel_prefix) or, without it, by PHP.

    4 methods

  • ShopController class

    The shop of a classroom: the files for sale, on one page. Each is bought in one step with omnibase/marketplace's quick order - an e-mail address, the payment, no account -, and the order's page lists the files (EventSubscriber\QuickOrderFilesListener).

    3 methods

Base\Classroom\DependencyInjection

Base\Classroom\DependencyInjection\Compiler

  • EmbedsConsentPass class

    What a sequence or a card frames (Canva, Padlet, a video...) comes with its provider's cookies: with omnibase/consent, it waits for the EMBEDS feature (the name omnibase/video's platform frames use), which this adds to the features every site starts from (consent.defaults, the bundle's own config/features.php) - on demand: listed in the detailed section on a page that frames something, never a reason to ask a visitor again - with what these providers were seen to keep. Its words are this bundle's translations/consent+intl-icu.*.yaml.

    1 method · 2 constants

Base\Classroom\Entity

  • Card class

    An idea card, the ones a colleague picks from the fan on the home page: a picture, a title, a line (the headline), a few paragraphs (the text), one to three links - to a sequence, a resource, a chronicle, a site -, and its levels and subjects.

    18 methods

  • ClassifiedTrait trait

    What the classroom's threads share: their levels, subjects and purposes are their omnibase taxa, read back by kind and written by kind (the back office's three pickers, see TaxaOfKindTrait).

    12 methods

  • Entitlement class

    The right to download a paid resource: written when the order holding its offer is paid (EventSubscriber\OrderPaidSubscriber), one per resource and buyer, remembering the order. Never expires; the file may be fetched again after a lost download.

    8 methods

  • Level class

    A class level, in a tree of cycles: Cycle 1 › PS, MS, GS; Cycle 2 › CP, CE1, CE2; Cycle 3 › CM1, CM2. An omnibase taxon: label, description and icon come with it. A thread carrying several levels is "multi-niveaux".

    8 methods

  • Purpose class

    "Pour la classe": what a thing is for rather than what it teaches - rituals, displays, autonomy, games, methods, organisation. An omnibase taxon.

    3 methods

  • Resource class

    A file to download - a PDF of cards, a game's spreadsheet, a set of flashcards zipped -, with a title, a description, a preview picture, its levels and subjects (taxa, like the threads), and who it is for: anyone, the members, or whoever bought it (a Product\ResourceOffer sells it). The file stays out of public/ (the local.classroom storage) and is served through signed links (glitchr/omnibase's Base\Service\DownloadLinks); each download is counted.

    46 methods

  • Sequence class

    A learning sequence: what it teaches (its subjects), to whom (its levels), when in the year (its period), what it aims at (objectives, competences of the programmes), what it needs (material), and its sessions - threads of their own, children of this one, in order. Its text is the presentation; its resources are the files to download.

    29 methods

  • Session class

    One session of a sequence - a thread whose parent is the sequence: its title, its place, its duration, its aim (the headline) and its course (the text, EditorJS). Read on the sequence's page, folded one under the other; published with it.

    13 methods

  • Subject class

    A discipline and its domains: Français › Lecture, Écriture, Grammaire…; Allemand › Vocabulaire, Culture…; Mathématiques, Questionner le monde, EMC, Arts, EPS. An omnibase taxon.

    5 methods

  • TaxaOfKindTrait trait

    One kind of taxa written at a time: the levels, the subjects and the purposes share one association (taxa), and each has its own picker in the back office. A picker sets the taxa of its kind and leaves the others where they are; a value that is not of its kind (an identifier no entity was found for, a taxon of another kind) is ignored, never handed to Doctrine.

Base\Classroom\Entity\Product

  • ResourceOffer class

    A resource for sale: a marketplace product whose delivery is a download.

    4 methods

Base\Classroom\Enum

  • Period enum

    The five periods of the French school year, between the holidays.

    1 method · 5 cases

  • Visibility enum

    Who may download a resource: anyone, the members, or whoever bought it.

    3 cases

Base\Classroom\EventSubscriber

  • OrderPaidSubscriber class

    What a paid order delivers here: an Entitlement to each resource whose offer it holds, for the buyer - and a mail with the link of the page where the files are downloaded (omnibase/marketplace's quick order page, signed: no account needed). A webhook and a redirect may both confirm the same order: an entitlement that exists is left alone, and the mail goes once.

    2 methods

  • QuickOrderFilesListener class

    The page of a quick order that bought files: the files themselves, each behind a signed download link (a day), once the order is paid. The page is reached by its own signed link - shown after the payment, and mailed (OrderPaidSubscriber) - so the files are for whoever holds it.

    3 methods

Base\Classroom\Repository

Base\Classroom\Security

  • ResourceVoter class

    Who may download a resource: anyone for a free one, the members (classroom.members_role) for a members' one, whoever holds an Entitlement for a paid one - and the administrators always.

    1 method · 1 constant

Base\Classroom\Service

  • SpreadsheetPreview class

    The first rows of a spreadsheet resource, as a table on its page: a colleague sees what the Kangourou file holds before downloading it. xlsx, xls, xlsm and ods through PhpSpreadsheet, csv read directly; the result cached until the resource changes.

    2 methods

  • Taxa class

    The levels, subjects and purposes, in order, as the menus and filters list them.

    8 methods

Base\Classroom\Twig

  • ClassroomExtension class

    What a host page asks the classroom: the taxa for its menus, the cards for its fan, the latest sequences and resources.

    3 methods

Base\Classroom

ClassroomBundle class

class ClassroomBundle extends AbstractBaseBundle ClassroomBundle.php:11

The open classroom: levels, subjects, sequences, cards and resources on omnibase's Thread and Taxon.

ClassroomBundle::__construct()

public function __construct()

ClassroomBundle::getPath()

public function getPath(): string

ClassroomBundle::build()

public function build(ContainerBuilder $container): void

Base\Classroom\Admin\Widget

ClassroomOverviewWidgetType class

final class ClassroomOverviewWidgetType implements DashboardWidgetTypeInterface ClassroomOverviewWidgetType.php:16

The classroom at a glance: sequences online and in draft, cards, resources, downloads, what was bought this month.

ClassroomOverviewWidgetType::__construct()

public function __construct(readonly EntityManagerInterface $entityManager, readonly SequenceRepository $sequences, readonly ResourceRepository $resources, readonly EntitlementRepository $entitlements)

ClassroomOverviewWidgetType::getName()

public static function getName(): string

ClassroomOverviewWidgetType::getTemplate()

public function getTemplate(): string

ClassroomOverviewWidgetType::getTemplateVars()

public function getTemplateVars(MenuItem $widget): array

Base\Classroom\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\Classroom\Controller\Admin\Crud

CardCrudController class

class CardCrudController extends AbstractCrudController CardCrudController.php:25

The idea cards: a picture, a title, a line, a few paragraphs, up to three links, levels and subjects.

CardCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

CardCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

CardCrudController::configureFilters()

public function configureFilters(Filters $filters): Filters

CardCrudController::configureActions()

public function configureActions(Actions $actions): Actions

CardCrudController::configureFields()

public function configureFields(string $pageName): iterable

CardCrudController::createEntity()

public function createEntity(string $entityFqcn): object

LevelCrudController class

class LevelCrudController extends TaxonCrudController LevelCrudController.php:14

The levels: omnibase's taxon screen, plus what a level adds.

LevelCrudController::configureActions()

public function configureActions(Actions $actions): Actions

LevelCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

LevelCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

PurposeCrudController class

class PurposeCrudController extends TaxonCrudController PurposeCrudController.php:12

The purposes: omnibase's taxon screen, plus what a purpose adds.

PurposeCrudController::configureActions()

public function configureActions(Actions $actions): Actions

PurposeCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

PurposeCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

ResourceCrudController class

class ResourceCrudController extends AbstractCrudController ResourceCrudController.php:32

The resources: the file (on the private storage), its saved name, who it is for, its preview picture, its levels and subjects. "Mettre en vente" creates the shop's offer for a paid one in one click (omnibase/marketplace).

ResourceCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

ResourceCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

ResourceCrudController::configureFilters()

public function configureFilters(Filters $filters): Filters

ResourceCrudController::configureFields()

public function configureFields(string $pageName): iterable

ResourceCrudController::configureActions()

public function configureActions(Actions $actions): Actions

ResourceCrudController::persistEntity()

public function persistEntity(EntityManagerInterface $entityManager, object $entity): void

Before the file lands: its name, type and size kept on the row.

ResourceCrudController::updateEntity()

public function updateEntity(EntityManagerInterface $entityManager, object $entity): void

ResourceCrudController::sell()

public function sell(string $entityId): Response

The shop's offer for this resource, made (or found) and opened for its price.

ResourceOfferCrudController class

class ResourceOfferCrudController extends ProductCrudController ResourceOfferCrudController.php:11

The resources for sale: the shop's product screen, plus the resource delivered.

ResourceOfferCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

ResourceOfferCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

ResourceOfferCrudController::configureFields()

public function configureFields(string $pageName): iterable

SequenceCrudController class

class SequenceCrudController extends AbstractCrudController SequenceCrudController.php:33

Writing a sequence: title, levels, subjects, purposes, period, duration, objectives and competences (one per line), material, the presentation (EditorJS, autosaved - and co-edited live when the relay runs), the resources attached, the cover. Its sessions have their own screen.

SequenceCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

SequenceCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

SequenceCrudController::configureFilters()

public function configureFilters(Filters $filters): Filters

SequenceCrudController::configureActions()

public function configureActions(Actions $actions): Actions

SequenceCrudController::configureFields()

public function configureFields(string $pageName): iterable

SequenceCrudController::createEntity()

public function createEntity(string $entityFqcn): object

SessionCrudController class

class SessionCrudController extends AbstractCrudController SessionCrudController.php:21

The sessions: which sequence, which place, how long, the aim, the course.

SessionCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

SessionCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

SessionCrudController::configureFilters()

public function configureFilters(Filters $filters): Filters

SessionCrudController::configureActions()

public function configureActions(Actions $actions): Actions

SessionCrudController::configureFields()

public function configureFields(string $pageName): iterable

SessionCrudController::createEntity()

public function createEntity(string $entityFqcn): object

SubjectCrudController class

class SubjectCrudController extends TaxonCrudController SubjectCrudController.php:13

The subjects: omnibase's taxon screen, plus what a subject adds.

SubjectCrudController::configureActions()

public function configureActions(Actions $actions): Actions

SubjectCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

SubjectCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

Base\Classroom\Controller\Client

ClassroomController class

class ClassroomController extends AbstractController ClassroomController.php:28

The classroom read by level, by subject, by purpose - the way a colleague looks for things: "CP › Allemand", "Multi-niveaux › Arts", "Pour la classe › Rituels" - each page listing the sequences, the cards and the resources that match, in the chronicle's order (newest first), by period when asked. Then the sequences, the cards, the resources on their own, and a search across all three.

ClassroomController::__construct()

public function __construct(readonly Taxa $taxa, readonly SequenceRepository $sequences, readonly CardRepository $cards, readonly ResourceRepository $resources, readonly int $perPage = 24)

ClassroomController::index()

public function index(): Response

ClassroomController::level()

public function level(Request $request, string $level, ?string $subject): Response

ClassroomController::subject()

public function subject(Request $request, string $subject): Response

ClassroomController::purpose()

public function purpose(Request $request, string $purpose): Response

ClassroomController::sequences()

public function sequences(Request $request): Response

ClassroomController::sequence()

public function sequence(string $slug): Response

ClassroomController::cards()

public function cards(Request $request): Response

ClassroomController::card()

public function card(string $slug): Response

ClassroomController::resources()

public function resources(Request $request): Response
public function search(Request $request): Response

ResourceController class

class ResourceController extends AbstractController ResourceController.php:30

A resource's page - its preview (a picture, or the first rows of a spreadsheet), its levels and subjects, the sequences it belongs to, the offer when it is for sale - and its download in two steps: the button checks who you are (ResourceVoter) and redirects to a signed, short-lived file URL, served by nginx (X-Accel-Redirect to classroom.accel_prefix) or, without it, by PHP.

ResourceController::__construct()

public function __construct(readonly ResourceRepository $resources, readonly EntitlementRepository $entitlements, readonly EntityManagerInterface $entityManager, readonly DownloadLinks $links, readonly SpreadsheetPreview $preview, readonly string $accelPrefix = '', readonly int $downloadTtl = 600)

ResourceController::show()

public function show(string $slug): Response

ResourceController::download()

public function download(string $slug): Response

ResourceController::serve()

public function serve(Request $request, int $id): Response

ShopController class

class ShopController extends AbstractController ShopController.php:18

The shop of a classroom: the files for sale, on one page. Each is bought in one step with omnibase/marketplace's quick order - an e-mail address, the payment, no account -, and the order's page lists the files (EventSubscriber\QuickOrderFilesListener).

ShopController::__construct()

public function __construct(readonly EntityManagerInterface $entityManager)

ShopController::index()

public function index(): Response

ShopController::sellable()

public static function sellable(ResourceOffer $offer): bool

For sale, its resource online with a file to hand over.

Base\Classroom\DependencyInjection

ClassroomConfiguration class

class ClassroomConfiguration extends AbstractBaseConfiguration ClassroomConfiguration.php:8

ClassroomConfiguration::getConfigTreeBuilder()

public function getConfigTreeBuilder(): TreeBuilder

ClassroomExtension class

class ClassroomExtension extends AbstractBaseExtension implements PrependExtensionInterface ClassroomExtension.php:12

ClassroomExtension::prepend()

public function prepend(ContainerBuilder $container): void

classroom.consent: whether the site has omnibase/consent, whose EMBEDS feature the frames then wait for (Compiler\EmbedsConsentPass declares it, classroom_consent() names it to the templates). Without it the frames load with the page, as before.

ClassroomExtension::getConfiguration()

public function getConfiguration(array $config, ContainerBuilder $container): ClassroomConfiguration

ClassroomExtension::load()

public function load(array $configs, ContainerBuilder $container): void

Base\Classroom\DependencyInjection\Compiler

EmbedsConsentPass class

final class EmbedsConsentPass implements CompilerPassInterface EmbedsConsentPass.php:25

What a sequence or a card frames (Canva, Padlet, a video...) comes with its provider's cookies: with omnibase/consent, it waits for the EMBEDS feature (the name omnibase/video's platform frames use), which this adds to the features every site starts from (consent.defaults, the bundle's own config/features.php) - on demand: listed in the detailed section on a page that frames something, never a reason to ask a visitor again - with what these providers were seen to keep. Its words are this bundle's translations/consent+intl-icu.*.yaml.

A default rather than a consent: configuration of its own: the site's consent.features.EMBEDS is laid over it field by field as over any of the bundle's features, defaults: false leaves it out, and it is no feature the site configured (data-consent-groups, the list pages served by consent-legacy.js read, stays the site's). Another bundle's EMBEDS keeps its fields; the entries it does not name are added to its storage.

const FEATURE = 'EMBEDS'
const STORAGE = [['name' => 'CDI', 'domain' => 'www.canva.com', 'duration' => '1y', 'purpose' => 'embeds_canva'], ['name' => 'CL', 'domain' => 'www.canva.com', 'duration' =>…

EmbedsConsentPass::process()

public function process(ContainerBuilder $container): void

Base\Classroom\Entity

Card class

class Card extends Thread implements LinkableInterface Card.php:20

An idea card, the ones a colleague picks from the fan on the home page: a picture, a title, a line (the headline), a few paragraphs (the text), one to three links - to a sequence, a resource, a chronicle, a site -, and its levels and subjects.

Card::__iconizeStatic()

public static function __iconizeStatic(): ?array
public function __toLink(array $routeParameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): ?string

Card::__toString()

public function __toString(): string

Card::getImage()

public function getImage(): ?string

Card::getImageFile()

public function getImageFile(): ?File

Card::setImage()

public function setImage($image): self
public function getLinks(): array
public function setLinks(array|string|null $links): self
$links

"label | url" per line when a string

Card::getLinksText()

public function getLinksText(): string

The links, one per line, for a textarea.

Card::setLinksText()

public function setLinksText(?string $text): self

Card::isFeatured()

public function isFeatured(): bool

Card::setFeatured()

public function setFeatured(bool $featured): self

Card::getPosition()

public function getPosition(): int

Card::setPosition()

public function setPosition(int $position): self

Card::getIcon()

public function getIcon(): ?string

Card::setIcon()

public function setIcon(?string $icon): self

Card::getColor()

public function getColor(): ?string

Card::setColor()

public function setColor(?string $color): self

ClassifiedTrait trait

trait ClassifiedTrait ClassifiedTrait.php:10

What the classroom's threads share: their levels, subjects and purposes are their omnibase taxa, read back by kind and written by kind (the back office's three pickers, see TaxaOfKindTrait).

ClassifiedTrait::getEmbeds()

public function getEmbeds(): array

ClassifiedTrait::setEmbeds()

public function setEmbeds(array|string|null $embeds): self
$embeds

"Label | https://…" per line when a string

ClassifiedTrait::getEmbedsText()

public function getEmbedsText(): string

The embeds, one per line, for a textarea.

ClassifiedTrait::setEmbedsText()

public function setEmbedsText(?string $text): self

ClassifiedTrait::getLevels()

public function getLevels(): array

ClassifiedTrait::setLevels()

public function setLevels(?iterable $levels): self
$levels

in place of the levels it had; its subjects and purposes stay

ClassifiedTrait::getSubjects()

public function getSubjects(): array

ClassifiedTrait::setSubjects()

public function setSubjects(?iterable $subjects): self
$subjects

in place of the subjects it had; its levels and purposes stay

ClassifiedTrait::getPurposes()

public function getPurposes(): array

ClassifiedTrait::setPurposes()

public function setPurposes(?iterable $purposes): self
$purposes

in place of the purposes it had; its levels and subjects stay

ClassifiedTrait::isMultiLevel()

public function isMultiLevel(): bool

Several levels at once: "multi-niveaux".

ClassifiedTrait::getLevelsLabel()

public function getLevelsLabel(): string

"CP · CE1"

Entitlement class

class Entitlement Entitlement.php:16

The right to download a paid resource: written when the order holding its offer is paid (EventSubscriber\OrderPaidSubscriber), one per resource and buyer, remembering the order. Never expires; the file may be fetched again after a lost download.

Entitlement::__construct()

public function __construct(?User $user = null, ?Resource $resource = null, ?string $orderReference = null)

Entitlement::getId()

public function getId(): ?int

Entitlement::getUser()

public function getUser(): ?User

Entitlement::getResource()

public function getResource(): ?Resource

Entitlement::getOrderReference()

public function getOrderReference(): ?string

Entitlement::getDownloads()

public function getDownloads(): int

Entitlement::countDownload()

public function countDownload(): self

Entitlement::getCreatedAt()

public function getCreatedAt(): ?\DateTimeInterface

Level class

class Level extends Taxon Level.php:14

A class level, in a tree of cycles: Cycle 1 › PS, MS, GS; Cycle 2 › CP, CE1, CE2; Cycle 3 › CM1, CM2. An omnibase taxon: label, description and icon come with it. A thread carrying several levels is "multi-niveaux".

Level::__iconizeStatic()

public static function __iconizeStatic(): ?array

Level::getPosition()

public function getPosition(): int

Level::setPosition()

public function setPosition(int $position): self

Level::getShort()

public function getShort(): ?string

Level::setShort()

public function setShort(?string $short): self

Level::getColor()

public function getColor(): ?string

Level::setColor()

public function setColor(?string $color): self

Level::isCycle()

public function isCycle(): bool

A cycle holds levels; a level holds none.

Purpose class

class Purpose extends Taxon Purpose.php:13

"Pour la classe": what a thing is for rather than what it teaches - rituals, displays, autonomy, games, methods, organisation. An omnibase taxon.

Purpose::__iconizeStatic()

public static function __iconizeStatic(): ?array

Purpose::getPosition()

public function getPosition(): int

Purpose::setPosition()

public function setPosition(int $position): self

Resource class

class Resource Resource.php:26

A file to download - a PDF of cards, a game's spreadsheet, a set of flashcards zipped -, with a title, a description, a preview picture, its levels and subjects (taxa, like the threads), and who it is for: anyone, the members, or whoever bought it (a Product\ResourceOffer sells it). The file stays out of public/ (the local.classroom storage) and is served through signed links (glitchr/omnibase's Base\Service\DownloadLinks); each download is counted.

Resource::__construct()

public function __construct(?User $owner = null, ?string $title = null)

Resource::__toString()

public function __toString(): string

Resource::getId()

public function getId(): ?int

Resource::getTitle()

public function getTitle(): ?string

Resource::setTitle()

public function setTitle(?string $title): self

Resource::getSlug()

public function getSlug(): ?string

Resource::setSlug()

public function setSlug(?string $slug): self

Resource::getDescription()

public function getDescription(): ?string

Resource::setDescription()

public function setDescription(?string $description): self

Resource::getFile()

public function getFile(): ?File

Resource::setFile()

public function setFile($file): self

Resource::hasFile()

public function hasFile(): bool

Resource::getFilename()

public function getFilename(): ?string

Resource::setFilename()

public function setFilename(?string $filename): self

Resource::getMimeType()

public function getMimeType(): ?string

Resource::setMimeType()

public function setMimeType(?string $mimeType): self

Resource::getSize()

public function getSize(): ?int

Resource::setSize()

public function setSize(?int $size): self

Resource::getExtension()

public function getExtension(): ?string

"pdf", "xlsx", "csv", "zip"… from the saved name, else from the type.

Resource::isSpreadsheet()

public function isSpreadsheet(): bool

Resource::getPreview()

public function getPreview(): ?string

Resource::getPreviewFile()

public function getPreviewFile(): ?File

Resource::setPreview()

public function setPreview($preview): self

Resource::getVisibility()

public function getVisibility(): Visibility

Resource::setVisibility()

public function setVisibility(Visibility|string $visibility): self

Resource::getVisibilityValue()

public function getVisibilityValue(): string

The raw value, for the admin's select.

Resource::setVisibilityValue()

public function setVisibilityValue(?string $visibility): self

Resource::isFree()

public function isFree(): bool

Resource::isPaid()

public function isPaid(): bool

Resource::isPublished()

public function isPublished(): bool

Resource::setPublished()

public function setPublished(bool $published): self

Resource::getTaxa()

public function getTaxa(): Collection

Resource::addTaxon()

public function addTaxon(\Base\Entity\Thread\Taxon $taxon): self

Resource::removeTaxon()

public function removeTaxon(\Base\Entity\Thread\Taxon $taxon): self

Resource::getLevels()

public function getLevels(): array

Resource::setLevels()

public function setLevels(?iterable $levels): self
$levels

in place of the levels it had; its subjects stay

Resource::getSubjects()

public function getSubjects(): array

Resource::setSubjects()

public function setSubjects(?iterable $subjects): self
$subjects

in place of the subjects it had; its levels stay

Resource::getLevelsLabel()

public function getLevelsLabel(): string

Resource::getSequences()

public function getSequences(): Collection

Resource::getDownloads()

public function getDownloads(): int

Resource::countDownload()

public function countDownload(): self

Resource::getOwner()

public function getOwner(): ?User

Resource::setOwner()

public function setOwner(?User $owner): self

Resource::getCreatedAt()

public function getCreatedAt(): ?\DateTimeInterface

Resource::getUpdatedAt()

public function getUpdatedAt(): ?\DateTimeInterface

Sequence class

class Sequence extends Thread implements LinkableInterface Sequence.php:24

A learning sequence: what it teaches (its subjects), to whom (its levels), when in the year (its period), what it aims at (objectives, competences of the programmes), what it needs (material), and its sessions - threads of their own, children of this one, in order. Its text is the presentation; its resources are the files to download.

Sequence::__iconizeStatic()

public static function __iconizeStatic(): ?array
public function __toLink(array $routeParameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): ?string

Sequence::__construct()

public function __construct(?\Base\Entity\User $owner = null, ?Thread $parent = null, ?string $title = null, ?string $slug = null)

Sequence::__toString()

public function __toString(): string

Sequence::getPeriod()

public function getPeriod(): ?Period

Sequence::setPeriod()

public function setPeriod(Period|string|null $period): self

Sequence::getPeriodValue()

public function getPeriodValue(): ?string

Sequence::setPeriodValue()

public function setPeriodValue(?string $period): self

Sequence::getDurationMinutes()

public function getDurationMinutes(): ?int

Sequence::setDurationMinutes()

public function setDurationMinutes(?int $minutes): self

Sequence::getObjectives()

public function getObjectives(): array

Sequence::setObjectives()

public function setObjectives(array|string|null $objectives): self
$objectives

one per line when a string

Sequence::getCompetences()

public function getCompetences(): array

Sequence::setCompetences()

public function setCompetences(array|string|null $competences): self

Sequence::getObjectivesText()

public function getObjectivesText(): string

The objectives and competences one per line, for a textarea.

Sequence::setObjectivesText()

public function setObjectivesText(?string $text): self

Sequence::getCompetencesText()

public function getCompetencesText(): string

Sequence::setCompetencesText()

public function setCompetencesText(?string $text): self

Sequence::getMaterials()

public function getMaterials(): ?string

Sequence::setMaterials()

public function setMaterials(?string $materials): self

Sequence::getCover()

public function getCover(): ?string

Sequence::getCoverFile()

public function getCoverFile(): ?File

Sequence::setCover()

public function setCover($cover): self

Sequence::isFeatured()

public function isFeatured(): bool

Sequence::setFeatured()

public function setFeatured(bool $featured): self

Sequence::getSessions()

public function getSessions(): array
Returns

in order

Sequence::getResources()

public function getResources(): Collection

Sequence::addResource()

public function addResource(Resource $resource): self

Sequence::removeResource()

public function removeResource(Resource $resource): self

Session class

class Session extends Thread implements LinkableInterface Session.php:18

One session of a sequence - a thread whose parent is the sequence: its title, its place, its duration, its aim (the headline) and its course (the text, EditorJS). Read on the sequence's page, folded one under the other; published with it.

Session::__iconizeStatic()

public static function __iconizeStatic(): ?array
public function __toLink(array $routeParameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): ?string

Session::__toString()

public function __toString(): string

Session::getSequence()

public function getSequence(): ?Sequence

Session::setSequence()

public function setSequence(?Sequence $sequence): self

Session::getPosition()

public function getPosition(): int

Session::setPosition()

public function setPosition(int $position): self

Session::getDurationMinutes()

public function getDurationMinutes(): ?int

Session::setDurationMinutes()

public function setDurationMinutes(?int $minutes): self

Session::getMaterials()

public function getMaterials(): array

Session::getMaterialsText()

public function getMaterialsText(): string

Session::setMaterialsText()

public function setMaterialsText(?string $text): self

Session::setMaterials()

public function setMaterials(array|string|null $materials): self

Subject class

class Subject extends Taxon Subject.php:14

A discipline and its domains: Français › Lecture, Écriture, Grammaire…; Allemand › Vocabulaire, Culture…; Mathématiques, Questionner le monde, EMC, Arts, EPS. An omnibase taxon.

Subject::__iconizeStatic()

public static function __iconizeStatic(): ?array

Subject::getPosition()

public function getPosition(): int

Subject::setPosition()

public function setPosition(int $position): self

Subject::getColor()

public function getColor(): ?string

Subject::setColor()

public function setColor(?string $color): self

TaxaOfKindTrait trait

trait TaxaOfKindTrait TaxaOfKindTrait.php:14

One kind of taxa written at a time: the levels, the subjects and the purposes share one association (taxa), and each has its own picker in the back office. A picker sets the taxa of its kind and leaves the others where they are; a value that is not of its kind (an identifier no entity was found for, a taxon of another kind) is ignored, never handed to Doctrine.

The class using it has getTaxa(), addTaxon() and removeTaxon().

Base\Classroom\Entity\Product

ResourceOffer class

class ResourceOffer extends Product ResourceOffer.php:15

A resource for sale: a marketplace product whose delivery is a download.

Paid, the order's EventSubscriber\OrderPaidSubscriber writes the buyer an Entitlement to the resource. Nothing ships: checkout asks for no address.

ResourceOffer::isShippable()

public function isShippable(): bool

ResourceOffer::getMaxQuantity()

public function getMaxQuantity(): ?int

One of each: a download bought twice is still one download.

ResourceOffer::getResource()

public function getResource(): ?Resource

ResourceOffer::setResource()

public function setResource(?Resource $resource): self

Base\Classroom\Enum

Period enum

enum Period Period.php:6

The five periods of the French school year, between the holidays.

case P1 = 'p1'
case P2 = 'p2'
case P3 = 'p3'
case P4 = 'p4'
case P5 = 'p5'

Period::number()

public function number(): int

Visibility enum

enum Visibility Visibility.php:6

Who may download a resource: anyone, the members, or whoever bought it.

case FREE = 'free'
case MEMBERS = 'members'
case PAID = 'paid'

Base\Classroom\EventSubscriber

OrderPaidSubscriber class

final class OrderPaidSubscriber OrderPaidSubscriber.php:27

What a paid order delivers here: an Entitlement to each resource whose offer it holds, for the buyer - and a mail with the link of the page where the files are downloaded (omnibase/marketplace's quick order page, signed: no account needed). A webhook and a redirect may both confirm the same order: an entitlement that exists is left alone, and the mail goes once.

OrderPaidSubscriber::__construct()

public function __construct(readonly EntityManagerInterface $entityManager, readonly EntitlementRepository $entitlements, readonly ?LoggerInterface $logger = null, readonly ?MailerInterface $mailer = null, readonly ?QuickOrder $quickOrder = null, readonly ?TranslatorInterface $translator = null, readonly ?string $from = null)

OrderPaidSubscriber::__invoke()

public function __invoke(OrderPaidEvent $event): void

QuickOrderFilesListener class

final class QuickOrderFilesListener QuickOrderFilesListener.php:19

The page of a quick order that bought files: the files themselves, each behind a signed download link (a day), once the order is paid. The page is reached by its own signed link - shown after the payment, and mailed (OrderPaidSubscriber) - so the files are for whoever holds it.

QuickOrderFilesListener::__construct()

public function __construct(readonly Environment $twig, readonly DownloadLinks $links)

QuickOrderFilesListener::__invoke()

public function __invoke(QuickOrderDoneEvent $event): void

QuickOrderFilesListener::resourcesOf()

public static function resourcesOf(Order $order): array
Returns

the files an order delivers

Base\Classroom\Repository

CardRepository class

class CardRepository extends ServiceEntityRepository CardRepository.php:12

CardRepository::__construct()

public function __construct(ManagerRegistry $registry)

CardRepository::findFeatured()

public function findFeatured(int $limit = 9): array

The fan: the featured cards in order, then the newest, up to $limit.

@return list<Card>

CardRepository::findPublished()

public function findPublished(array $taxa = [], int $limit = 200): array

CardRepository::findOnePublished()

public function findOnePublished(string $slug): ?Card
public function search(string $term, int $limit = 20): array

ClassifiedRepositoryTrait trait

trait ClassifiedRepositoryTrait ClassifiedRepositoryTrait.php:8

Filtering a thread query by taxa slugs: each slug given must be among the thread's taxa.

EntitlementRepository class

class EntitlementRepository extends ServiceEntityRepository EntitlementRepository.php:12

EntitlementRepository::__construct()

public function __construct(ManagerRegistry $registry)

EntitlementRepository::findForUser()

public function findForUser(?object $user): array
Returns

what this person bought, newest first

EntitlementRepository::findOne()

public function findOne(?object $user, Resource $resource): ?Entitlement

EntitlementRepository::countSince()

public function countSince(\DateTimeInterface $since): int

Since the first of the month: how many downloads were bought.

ResourceRepository class

class ResourceRepository extends ServiceEntityRepository ResourceRepository.php:11

ResourceRepository::__construct()

public function __construct(ManagerRegistry $registry)

ResourceRepository::findPublished()

public function findPublished(array $taxa = [], int $limit = 200): array
Returns

the published ones, newest first, of the taxa given

ResourceRepository::findOnePublished()

public function findOnePublished(string $slug): ?Resource
public function search(string $term, int $limit = 20): array

ResourceRepository::sumDownloads()

public function sumDownloads(): int

SequenceRepository class

class SequenceRepository extends ServiceEntityRepository SequenceRepository.php:12

SequenceRepository::__construct()

public function __construct(ManagerRegistry $registry)

SequenceRepository::findPublishedPage()

public function findPublishedPage(int $page = 1, int $perPage = 24, array $taxa = [], ?string $period = null): array
Returns

newest first, filtered by the taxa slugs given and the period

SequenceRepository::countPublished()

public function countPublished(array $taxa = [], ?string $period = null): int

SequenceRepository::findLatest()

public function findLatest(int $limit = 3): array

SequenceRepository::findOnePublished()

public function findOnePublished(string $slug): ?Sequence
public function search(string $term, int $limit = 20): array

SequenceRepository::countDrafts()

public function countDrafts(): int

SessionRepository class

class SessionRepository extends ServiceEntityRepository SessionRepository.php:10

SessionRepository::__construct()

public function __construct(ManagerRegistry $registry)

Base\Classroom\Security

ResourceVoter class

final class ResourceVoter extends Voter ResourceVoter.php:19

Who may download a resource: anyone for a free one, the members (classroom.members_role) for a members' one, whoever holds an Entitlement for a paid one - and the administrators always.

const DOWNLOAD = 'CLASSROOM_DOWNLOAD'

ResourceVoter::__construct()

public function __construct(readonly Security $security, readonly EntitlementRepository $entitlements, readonly string $membersRole = 'ROLE_USER')

Base\Classroom\Service

SpreadsheetPreview class

class SpreadsheetPreview SpreadsheetPreview.php:19

The first rows of a spreadsheet resource, as a table on its page: a colleague sees what the Kangourou file holds before downloading it. xlsx, xls, xlsm and ods through PhpSpreadsheet, csv read directly; the result cached until the resource changes.

SpreadsheetPreview::__construct()

public function __construct(readonly CacheInterface $cache, readonly int $rows = 30)

SpreadsheetPreview::sheets()

public function sheets(Resource $resource): array
Returns

one entry per sheet (one for a csv), empty when nothing can be read

Taxa class

final class Taxa Taxa.php:11

The levels, subjects and purposes, in order, as the menus and filters list them.

Taxa::__construct()

public function __construct(readonly EntityManagerInterface $entityManager)

Taxa::cycles()

public function cycles(): array
Returns

the cycles, each holding its levels

Taxa::levels()

public function levels(): array
Returns

the levels alone (CP, CE1...), in order

Taxa::subjects()

public function subjects(): array
Returns

the top subjects, each holding its domains

Taxa::purposes()

public function purposes(): array

Taxa::level()

public function level(string $slug): ?Level

Taxa::subject()

public function subject(string $slug): ?Subject

Taxa::purpose()

public function purpose(string $slug): ?Purpose

Base\Classroom\Twig

ClassroomExtension class

final class ClassroomExtension extends AbstractExtension ClassroomExtension.php:19

What a host page asks the classroom: the taxa for its menus, the cards for its fan, the latest sequences and resources.

ClassroomExtension::__construct()

public function __construct(readonly Taxa $taxa, readonly CardRepository $cards, readonly SequenceRepository $sequences, readonly ResourceRepository $resources, readonly Security $security, readonly bool $consent = false)

ClassroomExtension::getFunctions()

public function getFunctions(): array

ClassroomExtension::getFilters()

public function getFilters(): array