class ContactFormService implements ContactFormServiceInterface

Main services related to ContactForm

Properties

private ConfigServiceInterface $configService Stores ConfigServiceInterface
private ContactFormEmailInterface $contactFormEmail Stores ContactFormEmailInterface
private ContactFormFactoryInterface $contactFormFactory Stores ContactFormFactoryInterface
private Request $request Stores current Request
private ServiceToolsInterface $serviceTools Stores ServiceToolsInterface
private ServiceUserInterface $serviceUser Stores ServiceUserInterface

Methods

__construct(ConfigServiceInterface $configService, ContactFormEmailInterface $contactFormEmail, ContactFormFactoryInterface $contactFormFactory, RequestStack $requestStack, ServiceToolsInterface $serviceTools, ServiceUserInterface $serviceUser)

No description

create()

Creates the contactForm

Form
createForm(string $name, ContactForm $contactForm, ContactFormEvent $event)

Shortcut to call ContactFormFactory to create Form

string|null
getSubject()

Gets subject if provided by url parameter "s"

string|null
getReferer()

Gets referer defined in session

bool
isNotBot($username)

Tests if delay (defined in config) is not too short and if honeypot has not been filled, to avoid being used by bot

setReferer()

Defines the referer to redirect to after submission of form

string|null
sendEmail(Form $form, ContactFormEvent $event)

Sends email resulting from submission of form

Details

at line 66
__construct(ConfigServiceInterface $configService, ContactFormEmailInterface $contactFormEmail, ContactFormFactoryInterface $contactFormFactory, RequestStack $requestStack, ServiceToolsInterface $serviceTools, ServiceUserInterface $serviceUser)

Parameters

ConfigServiceInterface $configService
ContactFormEmailInterface $contactFormEmail
ContactFormFactoryInterface $contactFormFactory
RequestStack $requestStack
ServiceToolsInterface $serviceTools
ServiceUserInterface $serviceUser

at line 86
ContactForm create()

Creates the contactForm

Return Value

ContactForm

at line 111
Form createForm(string $name, ContactForm $contactForm, ContactFormEvent $event)

Shortcut to call ContactFormFactory to create Form

Parameters

string $name
ContactForm $contactForm
ContactFormEvent $event

Return Value

Form

at line 119
string|null getSubject()

Gets subject if provided by url parameter "s"

Return Value

string|null

at line 129
string|null getReferer()

Gets referer defined in session

Return Value

string|null

at line 145
bool isNotBot($username)

Tests if delay (defined in config) is not too short and if honeypot has not been filled, to avoid being used by bot

Parameters

$username

Return Value

bool

at line 158
setReferer()

Defines the referer to redirect to after submission of form

at line 166
string|null sendEmail(Form $form, ContactFormEvent $event)

Sends email resulting from submission of form

Parameters

Form $form
ContactFormEvent $event

Return Value

string|null