Skip to content

omnibase/consulting API reference

Floor
Prepared structure · Omnibase
Version
main
Verified for real
Its README does not say
Licence
MIT
composer require omnibase/consulting:dev-main

Read from the package's own PHP files at the commit c569525abedd: 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.

Base\Consulting

  • ConsultingBundle class

    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.

    3 methods

Base\Consulting\Admin\Widget

  • QuoteRequestsWidgetType class

    The dashboard's "Quote requests": how many wait for an answer, the latest five. `yield MenuItem::block('consulting_quotes', ...)` places it.

    4 methods

Base\Consulting\Command

  • PurgeCommand class

    The 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

  • OfferingCrudController class

    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.

    4 methods

  • QuoteRequestCrudController class

    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.

    9 methods

Base\Consulting\Controller\Client

  • ConsultingController class

    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.

    4 methods

Base\Consulting\DependencyInjection

Base\Consulting\Entity

  • Offering class

    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).

    37 methods

  • QuoteRequest class

    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.

    30 methods

Base\Consulting\Enum

  • Activity enum

    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).

    2 methods · 6 cases

  • QuoteStatus enum

    A quote request: just arrived, answered, set aside.

    2 methods · 3 cases

Base\Consulting\Form\Model

  • QuoteRequestModel class

    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.

    1 method · 7 properties

Base\Consulting\Form\Type

  • QuoteRequestType class

    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.

    3 methods

Base\Consulting\Offering

  • OfferingRuleInterface interface

    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.

    1 method · 1 constant

  • OfferingViolation class

    What a rule refuses in an offering: the words said, and the field they are said under.

    1 method · 2 properties

Base\Consulting\Repository

Base\Consulting\Service

  • CreditBridge class

    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.

    2 methods · 1 constant

  • JsonLd class

    The offerings as schema.org reads them: a Service each, an OfferCatalog for the page.

    3 methods

Base\Consulting\Twig

  • ConsultingExtension class

    What a host's own pages ask: the offerings for a home page, whether one can be paid by the hour.

    2 methods

Base\Consulting\Validator

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(): string

Modern layout: the class lives in src/, the bundle root is the package root.

ConsultingBundle::build()

public function build(ContainerBuilder $container): void

Base\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(): string

QuoteRequestsWidgetType::getTemplate()

public function getTemplate(): string

QuoteRequestsWidgetType::getTemplateVars()

public function getTemplateVars(MenuItem $widget): array

Base\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): void

OfferingCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

OfferingCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

OfferingCrudController::configureFields()

public function configureFields(string $pageName): iterable

QuoteRequestCrudController 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): void

QuoteRequestCrudController::getEntityFqcn()

public static function getEntityFqcn(): string

QuoteRequestCrudController::getPreferredIcon()

public static function getPreferredIcon(): ?string

QuoteRequestCrudController::configureCrud()

public function configureCrud(Crud $crud): Crud

QuoteRequestCrudController::configureFilters()

public function configureFilters(Filters $filters): Filters

QuoteRequestCrudController::configureActions()

public function configureActions(Actions $actions): Actions

QuoteRequestCrudController::configureFields()

public function configureFields(string $pageName): iterable

QuoteRequestCrudController::answered()

public function answered(Request $request, string $entityId): Response

QuoteRequestCrudController::archive()

public function archive(Request $request, string $entityId): Response

Base\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(): Response

ConsultingController::offering()

public function offering(string $slug): Response

ConsultingController::quote()

public function quote(Request $request, FormFactoryInterface $forms, EntityManagerInterface $entityManager, MailerInterface $mailer, TranslatorInterface $translator, string $recipient): Response

Base\Consulting\DependencyInjection

ConsultingConfiguration class

class ConsultingConfiguration extends AbstractBaseConfiguration ConsultingConfiguration.php:8

ConsultingConfiguration::getConfigTreeBuilder()

public function getConfigTreeBuilder(): TreeBuilder

ConsultingExtension class

class ConsultingExtension extends AbstractBaseExtension ConsultingExtension.php:11

ConsultingExtension::getConfiguration()

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

ConsultingExtension::load()

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

Base\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(): string

Offering::getId()

public function getId(): ?int

Offering::getTitle()

public function getTitle(): ?string

Offering::setTitle()

public function setTitle(?string $title): self

Offering::getSlug()

public function getSlug(): ?string

Offering::setSlug()

public function setSlug(?string $slug): self

Offering::getActivity()

public function getActivity(): Activity

Offering::setActivity()

public function setActivity(Activity|string $activity): self

Offering::getSummary()

public function getSummary(): ?string

Offering::setSummary()

public function setSummary(?string $summary): self

Offering::getDescription()

public function getDescription(): ?string

Offering::setDescription()

public function setDescription(?string $description): self

Offering::isHtml()

public function isHtml(): bool

Whether the description is HTML (from the editor or an import) rather than plain text.

Offering::getAudience()

public function getAudience(): ?string

Offering::setAudience()

public function setAudience(?string $audience): self

Offering::getFormat()

public function getFormat(): ?string

Offering::setFormat()

public function setFormat(?string $format): self

Offering::getDuration()

public function getDuration(): ?string

Offering::setDuration()

public function setDuration(?string $duration): self

Offering::getPrice()

public function getPrice(): ?string

Offering::setPrice()

public function setPrice(?string $price): self

Offering::getHours()

public function getHours(): ?int

Offering::setHours()

public function setHours(?int $hours): self

Offering::getLanguages()

public function getLanguages(): ?string

Offering::setLanguages()

public function setLanguages(?string $languages): self

Offering::getImage()

public function getImage(): ?string

Offering::getImageFile()

public function getImageFile(): ?File

Offering::setImage()

public function setImage($image): self

Offering::getImageUrl()

public function getImageUrl(): ?string

The picture's address on the site ("/uploads/…").

Offering::isQuotable()

public function isQuotable(): bool

Offering::setQuotable()

public function setQuotable(bool $quotable): self

Offering::getPosition()

public function getPosition(): int

Offering::setPosition()

public function setPosition(?int $position): self

Offering::isVisible()

public function isVisible(): bool

Offering::setVisible()

public function setVisible(bool $visible): self

Offering::getText()

public function getText(): string

Every 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(): string

QuoteRequest::getId()

public function getId(): ?int

QuoteRequest::getOffering()

public function getOffering(): ?Offering

QuoteRequest::setOffering()

public function setOffering(?Offering $offering): self

QuoteRequest::getStatus()

public function getStatus(): QuoteStatus

QuoteRequest::setStatus()

public function setStatus(QuoteStatus|string $status): self

QuoteRequest::getName()

public function getName(): string

QuoteRequest::setName()

public function setName(?string $name): self

QuoteRequest::getEmail()

public function getEmail(): string

QuoteRequest::setEmail()

public function setEmail(?string $email): self

QuoteRequest::getPhone()

public function getPhone(): ?string

QuoteRequest::setPhone()

public function setPhone(?string $phone): self

QuoteRequest::getOrganisation()

public function getOrganisation(): ?string

QuoteRequest::setOrganisation()

public function setOrganisation(?string $organisation): self

QuoteRequest::getParticipants()

public function getParticipants(): ?string

QuoteRequest::setParticipants()

public function setParticipants(?string $participants): self

QuoteRequest::getDates()

public function getDates(): ?string

QuoteRequest::setDates()

public function setDates(?string $dates): self

QuoteRequest::getLocation()

public function getLocation(): ?string

QuoteRequest::setLocation()

public function setLocation(?string $location): self

QuoteRequest::getBudget()

public function getBudget(): ?string

QuoteRequest::setBudget()

public function setBudget(?string $budget): self

QuoteRequest::getMessage()

public function getMessage(): string

QuoteRequest::setMessage()

public function setMessage(?string $message): self

QuoteRequest::getLocale()

public function getLocale(): ?string

QuoteRequest::setLocale()

public function setLocale(?string $locale): self

QuoteRequest::getNotes()

public function getNotes(): ?string

QuoteRequest::setNotes()

public function setNotes(?string $notes): self

QuoteRequest::getCreatedAt()

public function getCreatedAt(): \DateTimeImmutable

Base\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(): string

Activity::trans()

public function trans(TranslatorInterface $translator, ?string $locale = null): string

Its 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(): string

QuoteStatus::trans()

public function trans(TranslatorInterface $translator, ?string $locale = null): string

Its 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 = null
public ?string $organisation = null
public ?string $participants = null
public ?string $dates = null
public ?string $location = null
public ?string $budget = null

QuoteRequestModel::toQuoteRequest()

public function toQuoteRequest(?string $locale = null): QuoteRequest

Base\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(): string

QuoteRequestType::configureOptions()

public function configureOptions(OptionsResolver $resolver): void

QuoteRequestType::buildForm()

public function buildForm(FormBuilderInterface $builder, array $options): void

Base\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): ?OfferingViolation

Why 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 $message

Already translated: the rule knows its own words.

public string $path

The 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): ?Offering

QuoteRequestRepository 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(): int

QuoteRequestRepository::purgeOlderThan()

public function purgeOlderThan(\DateTimeImmutable $before): int

The 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(): bool

Whether the marketplace can sell hours at all.

CreditBridge::canSell()

public function canSell(Offering $offering): bool

Whether 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): array

JsonLd::catalog()

public function catalog(array $offerings): array

Base\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(): array

Base\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(): string

OfferingRulesValidator 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