Lue dans les fichiers PHP du paquet au commit c569525abedd : 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é.
ConsultingBundleclassAn independent professional's services on their own site: what they offer (Offering: a workshop, a keynote, a training, a consultation - who it is for, how it runs, its price as it should be printed), the quote request on omnibase's contact model (QuoteRequest, kept and answered from the back office), and the rules an offering keeps that the site or a profession adds (Offering\OfferingRuleInterface: a jurist's, from omnibase/legal). Hours paid in advance will be omnibase/marketplace Credits.
3 methods
QuoteRequestsWidgetTypeclassThe dashboard's "Quote requests": how many wait for an answer, the latest five. `yield MenuItem::block('consulting_quotes', ...)` places it.
4 methods
PurgeCommandclassThe quote requests kept no longer than the form's notice says (consulting.retention_months): run it from cron, once a day.
1 method
Base\Consulting\Controller\Admin\Crud
OfferingCrudControllerclassWhat the site offers: each service's activity, its texts, for whom, how, how long, its price as printed, a package of hours, a picture, whether a quote may be asked. What the site's rules refuse (Offering\OfferingRuleInterface) is printed under the field it concerns.
4 methods
QuoteRequestCrudControllerclassThe quote requests from the site, read and followed: answered, archived, a note of what was answered. They come from the site's form only.
9 methods
Base\Consulting\Controller\Client
ConsultingControllerclassThe services: what is offered (/services), each one's page, and the quote request - omnibase's contact form with what a quote needs, kept for the back office and sent to the site's address. The form's guard (glitchr/omnibase's option `guard`) refuses a robot before anything is kept.
4 methods
Base\Consulting\DependencyInjection
ConsultingConfigurationclass1 method
ConsultingExtensionclass2 methods
OfferingclassA service the site offers: a teachers' workshop, a keynote, a show, a training, a consultation. What it is (its activity), who it is for, how it runs and for how long, its price as it should be printed ("On quote", "From €1,500 excl. VAT"), a picture, and whether a quote may be asked for it. `hours`: a package of hours, the point where omnibase/marketplace's Credits will sell it (Service\CreditBridge).
37 methods
QuoteRequestclassA quote asked from the site: for which offering (or none: "something else"), who asks and for which organisation, how many people, when and where, the budget if they say, their message - kept for the back office (new, answered, archived) as long as the form's notice says.
30 methods
ActivityenumWhat an offering is: a training, a talk or a show, consulting, documentary information, writing content. Nothing here is reserved to a regulated profession: what the law of 31 December 1971 keeps for lawyers and notaries (a personalised legal consultation, deeds drafted for others) is not an offering of this bundle - a jurist's site guards against it with omnibase/legal (legal.profession: jurist).
2 methods · 6 cases
QuoteStatusenumA quote request: just arrived, answered, set aside.
2 methods · 3 cases
QuoteRequestModelclassWhat the quote request form sends: omnibase's contact model (a name, an e-mail, a phone, the message) and what a quote needs - the offering, the organisation, how many people, when, where, the budget, and the notice read and accepted.
1 method · 7 properties
QuoteRequestTypeclassThe quote request: omnibase's contact form (Base\Form\Type\ContactType: name, e-mail, phone, message) with what a quote needs on top - the offering, the organisation, the participants, the dates, the place, the budget - and the notice to accept. Guarded as glitchr/omnibase guards a form (option `guard`, Base\Service\FormGuard): a trap, the time it takes, the lists, the captcha when glitchr/omnishield has one - in place of the contact form's own `website` trap.
3 methods
OfferingRuleInterfaceinterfaceA rule an offering must keep before it is saved, that this bundle does not know: a profession's (omnibase/legal's jurist profile refuses an offering that announces what the law reserves to a regulated profession), or the application's own. Each is an autoconfigured service; the #[OfferingRules] constraint on Offering asks them all, and the back office's form prints what they answer under the field they name.
1 method · 1 constant
OfferingViolationclassWhat a rule refuses in an offering: the words said, and the field they are said under.
1 method · 2 properties
OfferingRepositoryclass3 methods
QuoteRequestRepositoryclass4 methods
CreditBridgeclassWhere hours paid in advance will plug in: omnibase/marketplace's generic `Credit` (plan 0 §5, written with the events platform) sells an offering's package of hours and counts them down. Until that class exists, nothing is sold - the offering shows its price and the quote request. Nothing else is written here on purpose: no entity of hours of our own, no copy of forge's HourCredit.
2 methods · 1 constant
JsonLdclassThe offerings as schema.org reads them: a Service each, an OfferCatalog for the page.
3 methods
ConsultingExtensionclassWhat a host's own pages ask: the offerings for a home page, whether one can be paid by the hour.
2 methods
OfferingRulesclassThe offering keeps every rule the site has (Base\Consulting\Offering\OfferingRuleInterface).
1 method
OfferingRulesValidatorclass2 methods
Base\Consulting
ConsultingBundle class
class ConsultingBundle extends AbstractBaseBundle ConsultingBundle.php:18
An independent professional's services on their own site: what they offer (Offering: a workshop, a keynote, a training, a consultation - who it is for, how it runs, its price as it should be printed), the quote request on omnibase's contact model (QuoteRequest, kept and answered from the back office), and the rules an offering keeps that the site or a profession adds (Offering\OfferingRuleInterface: a jurist's, from omnibase/legal). Hours paid in advance will be omnibase/marketplace Credits.
ConsultingBundle::__construct()
public function __construct()ConsultingBundle::getPath()
public function getPath(): stringModern layout: the class lives in src/, the bundle root is the package root.
ConsultingBundle::build()
public function build(ContainerBuilder $container): voidBase\Consulting\Admin\Widget
QuoteRequestsWidgetType class
final class QuoteRequestsWidgetType implements DashboardWidgetTypeInterface QuoteRequestsWidgetType.php:13
The dashboard's "Quote requests": how many wait for an answer, the
latest five. yield MenuItem::block('consulting_quotes', ...) places it.
QuoteRequestsWidgetType::__construct()
public function __construct(readonly QuoteRequestRepository $quotes)QuoteRequestsWidgetType::getName()
public static function getName(): stringQuoteRequestsWidgetType::getTemplate()
public function getTemplate(): stringQuoteRequestsWidgetType::getTemplateVars()
public function getTemplateVars(MenuItem $widget): arrayBase\Consulting\Command
PurgeCommand class
final class PurgeCommand extends Command PurgeCommand.php:17
The quote requests kept no longer than the form's notice says (consulting.retention_months): run it from cron, once a day.
PurgeCommand::__construct()
public function __construct(readonly QuoteRequestRepository $quotes, readonly int $months = 36)Base\Consulting\Controller\Admin\Crud
OfferingCrudController class
class OfferingCrudController extends AbstractCrudController OfferingCrudController.php:27
What the site offers: each service's activity, its texts, for whom, how, how long, its price as printed, a package of hours, a picture, whether a quote may be asked. What the site's rules refuse (Offering\OfferingRuleInterface) is printed under the field it concerns.
OfferingCrudController::setConsultingServices()
public function setConsultingServices(TranslatorInterface $translator): voidOfferingCrudController::getEntityFqcn()
public static function getEntityFqcn(): stringOfferingCrudController::getPreferredIcon()
public static function getPreferredIcon(): ?stringOfferingCrudController::configureFields()
public function configureFields(string $pageName): iterableQuoteRequestCrudController class
class QuoteRequestCrudController extends AbstractCrudController QuoteRequestCrudController.php:29
The quote requests from the site, read and followed: answered, archived, a note of what was answered. They come from the site's form only.
QuoteRequestCrudController::setTranslator()
public function setTranslator(TranslatorInterface $translator): voidQuoteRequestCrudController::getEntityFqcn()
public static function getEntityFqcn(): stringQuoteRequestCrudController::getPreferredIcon()
public static function getPreferredIcon(): ?stringQuoteRequestCrudController::configureCrud()
public function configureCrud(Crud $crud): CrudQuoteRequestCrudController::configureFilters()
public function configureFilters(Filters $filters): FiltersQuoteRequestCrudController::configureActions()
public function configureActions(Actions $actions): ActionsQuoteRequestCrudController::configureFields()
public function configureFields(string $pageName): iterableQuoteRequestCrudController::answered()
public function answered(Request $request, string $entityId): ResponseQuoteRequestCrudController::archive()
public function archive(Request $request, string $entityId): ResponseBase\Consulting\Controller\Client
ConsultingController class
class ConsultingController extends AbstractController ConsultingController.php:30
The services: what is offered (/services), each one's page, and the quote
request - omnibase's contact form with what a quote needs, kept for the
back office and sent to the site's address. The form's guard (glitchr/omnibase's
option guard) refuses a robot before anything is kept.
ConsultingController::__construct()
public function __construct(readonly OfferingRepository $offerings, readonly CreditBridge $credits, readonly JsonLd $jsonLd, readonly int $retention = 36)ConsultingController::offerings()
public function offerings(): ResponseConsultingController::offering()
public function offering(string $slug): ResponseConsultingController::quote()
public function quote(Request $request, FormFactoryInterface $forms, EntityManagerInterface $entityManager, MailerInterface $mailer, TranslatorInterface $translator, string $recipient): ResponseBase\Consulting\DependencyInjection
ConsultingConfiguration class
class ConsultingConfiguration extends AbstractBaseConfiguration ConsultingConfiguration.php:8
ConsultingConfiguration::getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilderConsultingExtension class
class ConsultingExtension extends AbstractBaseExtension ConsultingExtension.php:11
ConsultingExtension::getConfiguration()
public function getConfiguration(array $config, ContainerBuilder $container): ConsultingConfigurationConsultingExtension::load()
public function load(array $configs, ContainerBuilder $container): voidBase\Consulting\Entity
Offering class
class Offering Offering.php:23
A service the site offers: a teachers' workshop, a keynote, a show, a
training, a consultation. What it is (its activity),
who it is for, how it runs and for how long, its price as it should be
printed ("On quote", "From €1,500 excl. VAT"), a picture, and whether a
quote may be asked for it. hours: a package of hours, the point where
omnibase/marketplace's Credits will sell it (Service\CreditBridge).
Offering::__construct()
public function __construct(?string $title = null, Activity $activity = Activity::TRAINING)Offering::__toString()
public function __toString(): stringOffering::getId()
public function getId(): ?intOffering::getTitle()
public function getTitle(): ?stringOffering::setTitle()
public function setTitle(?string $title): selfOffering::getSlug()
public function getSlug(): ?stringOffering::setSlug()
public function setSlug(?string $slug): selfOffering::getActivity()
public function getActivity(): ActivityOffering::setActivity()
public function setActivity(Activity|string $activity): selfOffering::getSummary()
public function getSummary(): ?stringOffering::setSummary()
public function setSummary(?string $summary): selfOffering::getDescription()
public function getDescription(): ?stringOffering::setDescription()
public function setDescription(?string $description): selfOffering::isHtml()
public function isHtml(): boolWhether the description is HTML (from the editor or an import) rather than plain text.
Offering::getAudience()
public function getAudience(): ?stringOffering::setAudience()
public function setAudience(?string $audience): selfOffering::getFormat()
public function getFormat(): ?stringOffering::setFormat()
public function setFormat(?string $format): selfOffering::getDuration()
public function getDuration(): ?stringOffering::setDuration()
public function setDuration(?string $duration): selfOffering::getPrice()
public function getPrice(): ?stringOffering::setPrice()
public function setPrice(?string $price): selfOffering::getHours()
public function getHours(): ?intOffering::setHours()
public function setHours(?int $hours): selfOffering::getLanguages()
public function getLanguages(): ?stringOffering::setLanguages()
public function setLanguages(?string $languages): selfOffering::getImage()
public function getImage(): ?stringOffering::getImageFile()
public function getImageFile(): ?FileOffering::setImage()
public function setImage($image): selfOffering::getImageUrl()
public function getImageUrl(): ?stringThe picture's address on the site ("/uploads/…").
Offering::isQuotable()
public function isQuotable(): boolOffering::setQuotable()
public function setQuotable(bool $quotable): selfOffering::getPosition()
public function getPosition(): intOffering::setPosition()
public function setPosition(?int $position): selfOffering::isVisible()
public function isVisible(): boolOffering::setVisible()
public function setVisible(bool $visible): selfOffering::getText()
public function getText(): stringEvery word of it, for a rule to read (Offering\OfferingRuleInterface).
QuoteRequest class
class QuoteRequest QuoteRequest.php:15
A quote asked from the site: for which offering (or none: "something else"), who asks and for which organisation, how many people, when and where, the budget if they say, their message - kept for the back office (new, answered, archived) as long as the form's notice says.
QuoteRequest::__construct()
public function __construct()QuoteRequest::__toString()
public function __toString(): stringQuoteRequest::getId()
public function getId(): ?intQuoteRequest::getOffering()
public function getOffering(): ?OfferingQuoteRequest::setOffering()
public function setOffering(?Offering $offering): selfQuoteRequest::getStatus()
public function getStatus(): QuoteStatusQuoteRequest::setStatus()
public function setStatus(QuoteStatus|string $status): selfQuoteRequest::getName()
public function getName(): stringQuoteRequest::setName()
public function setName(?string $name): selfQuoteRequest::getEmail()
public function getEmail(): stringQuoteRequest::setEmail()
public function setEmail(?string $email): selfQuoteRequest::getPhone()
public function getPhone(): ?stringQuoteRequest::setPhone()
public function setPhone(?string $phone): selfQuoteRequest::getOrganisation()
public function getOrganisation(): ?stringQuoteRequest::setOrganisation()
public function setOrganisation(?string $organisation): selfQuoteRequest::getParticipants()
public function getParticipants(): ?stringQuoteRequest::setParticipants()
public function setParticipants(?string $participants): selfQuoteRequest::getDates()
public function getDates(): ?stringQuoteRequest::setDates()
public function setDates(?string $dates): selfQuoteRequest::getLocation()
public function getLocation(): ?stringQuoteRequest::setLocation()
public function setLocation(?string $location): selfQuoteRequest::getBudget()
public function getBudget(): ?stringQuoteRequest::setBudget()
public function setBudget(?string $budget): selfQuoteRequest::getMessage()
public function getMessage(): stringQuoteRequest::setMessage()
public function setMessage(?string $message): selfQuoteRequest::getLocale()
public function getLocale(): ?stringQuoteRequest::setLocale()
public function setLocale(?string $locale): selfQuoteRequest::getNotes()
public function getNotes(): ?stringQuoteRequest::setNotes()
public function setNotes(?string $notes): selfQuoteRequest::getCreatedAt()
public function getCreatedAt(): \DateTimeImmutableBase\Consulting\Enum
Activity enum
enum Activity implements TranslatableInterface Activity.php:16
What an offering is: a training, a talk or a show, consulting, documentary information, writing content. Nothing here is reserved to a regulated profession: what the law of 31 December 1971 keeps for lawyers and notaries (a personalised legal consultation, deeds drafted for others) is not an offering of this bundle - a jurist's site guards against it with omnibase/legal (legal.profession: jurist).
case TRAINING = 'training'case TALK = 'talk'case CONSULTING = 'consulting'case INFORMATION = 'information'case WRITING = 'writing'case OTHER = 'other'
Activity::label()
public function label(): stringActivity::trans()
public function trans(TranslatorInterface $translator, ?string $locale = null): stringIts name in the consulting domain: what a select of the back office shows.
QuoteStatus enum
enum QuoteStatus implements TranslatableInterface QuoteStatus.php:9
A quote request: just arrived, answered, set aside.
case NEW = 'new'case ANSWERED = 'answered'case ARCHIVED = 'archived'
QuoteStatus::label()
public function label(): stringQuoteStatus::trans()
public function trans(TranslatorInterface $translator, ?string $locale = null): stringIts name in the consulting domain: what a select of the back office shows.
Base\Consulting\Form\Model
QuoteRequestModel class
class QuoteRequestModel extends ContactModel QuoteRequestModel.php:16
What the quote request form sends: omnibase's contact model (a name, an e-mail, a phone, the message) and what a quote needs - the offering, the organisation, how many people, when, where, the budget, and the notice read and accepted.
public ?Offering $offering = nullpublic ?string $organisation = nullpublic ?string $participants = nullpublic ?string $dates = nullpublic ?string $location = nullpublic ?string $budget = nullpublic bool $consent = false
QuoteRequestModel::toQuoteRequest()
public function toQuoteRequest(?string $locale = null): QuoteRequestBase\Consulting\Form\Type
QuoteRequestType class
class QuoteRequestType extends AbstractType QuoteRequestType.php:25
The quote request: omnibase's contact form (Base\Form\Type\ContactType:
name, e-mail, phone, message) with what a quote needs on top - the
offering, the organisation, the participants, the dates, the place, the
budget - and the notice to accept. Guarded as glitchr/omnibase guards a
form (option guard, Base\Service\FormGuard): a trap, the time it takes,
the lists, the captcha when glitchr/omnishield has one - in place of the
contact form's own website trap.
QuoteRequestType::getParent()
public function getParent(): stringQuoteRequestType::configureOptions()
public function configureOptions(OptionsResolver $resolver): voidQuoteRequestType::buildForm()
public function buildForm(FormBuilderInterface $builder, array $options): voidBase\Consulting\Offering
OfferingRuleInterface interface
interface OfferingRuleInterface OfferingRuleInterface.php:24
A rule an offering must keep before it is saved, that this bundle does not know: a profession's (omnibase/legal's jurist profile refuses an offering that announces what the law reserves to a regulated profession), or the application's own. Each is an autoconfigured service; the #[OfferingRules] constraint on Offering asks them all, and the back office's form prints what they answer under the field they name.
final class NoPricesRule implements OfferingRuleInterface { public function check(Offering $offering): ?OfferingViolation { return null !== $offering->getPrice() ? new OfferingViolation('No price on this site.', 'price') : null; } }
const TAG = 'consulting.offering_rule'
OfferingRuleInterface::check()
public function check(Offering $offering): ?OfferingViolationWhy the offering may not be saved, or null when it may.
OfferingViolation class
final readonly class OfferingViolation OfferingViolation.php:6
What a rule refuses in an offering: the words said, and the field they are said under.
public string $messageAlready translated: the rule knows its own words.
public string $pathThe offering's property the form prints it under: title, summary, description, activity.
..
OfferingViolation::__construct()
public function __construct(public string $message, public string $path = 'description')Base\Consulting\Repository
OfferingRepository class
class OfferingRepository extends ServiceEntityRepository OfferingRepository.php:10
OfferingRepository::__construct()
public function __construct(ManagerRegistry $registry)OfferingRepository::findVisible()
public function findVisible(?int $limit = null): array- Returns
the visible ones, in their order
OfferingRepository::findOneVisible()
public function findOneVisible(string $slug): ?OfferingQuoteRequestRepository class
class QuoteRequestRepository extends ServiceEntityRepository QuoteRequestRepository.php:11
QuoteRequestRepository::__construct()
public function __construct(ManagerRegistry $registry)QuoteRequestRepository::findNew()
public function findNew(?int $limit = null): array- Returns
the new ones, latest first
QuoteRequestRepository::countNew()
public function countNew(): intQuoteRequestRepository::purgeOlderThan()
public function purgeOlderThan(\DateTimeImmutable $before): intThe requests older than the notice says they are kept: removed, whatever their status.
Base\Consulting\Service
CreditBridge class
final class CreditBridge CreditBridge.php:15
Where hours paid in advance will plug in: omnibase/marketplace's
generic Credit (plan 0 §5, written with the events platform) sells an
offering's package of hours and counts them down. Until that class
exists, nothing is sold - the offering shows its price and the quote
request. Nothing else is written here on purpose: no entity of hours of
our own, no copy of forge's HourCredit.
const CREDIT_CLASS = 'Base\Marketplace\Entity\Credit'
CreditBridge::isAvailable()
public function isAvailable(): boolWhether the marketplace can sell hours at all.
CreditBridge::canSell()
public function canSell(Offering $offering): boolWhether this offering could be paid by the hour now.
JsonLd class
final class JsonLd JsonLd.php:11
The offerings as schema.org reads them: a Service each, an OfferCatalog for the page.
JsonLd::__construct()
public function __construct(readonly UrlGeneratorInterface $urls, readonly ?SettingBagInterface $settings = null, readonly ?string $provider = null)JsonLd::service()
public function service(Offering $offering, bool $context = true): arrayJsonLd::catalog()
public function catalog(array $offerings): arrayBase\Consulting\Twig
ConsultingExtension class
final class ConsultingExtension extends AbstractExtension ConsultingExtension.php:12
What a host's own pages ask: the offerings for a home page, whether one can be paid by the hour.
ConsultingExtension::__construct()
public function __construct(readonly OfferingRepository $offerings, readonly CreditBridge $credits)ConsultingExtension::getFunctions()
public function getFunctions(): arrayBase\Consulting\Validator
OfferingRules class
final class OfferingRules extends Constraint OfferingRules.php:8
The offering keeps every rule the site has (Base\Consulting\Offering\OfferingRuleInterface).
OfferingRules::getTargets()
public function getTargets(): stringOfferingRulesValidator class
final class OfferingRulesValidator extends ConstraintValidator OfferingRulesValidator.php:11
OfferingRulesValidator::__construct()
public function __construct(readonly iterable $rules = [])OfferingRulesValidator::validate()
public function validate(mixed $value, Constraint $constraint): void