Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
recurring_events-3312242
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
recurring_events-3312242
Commits
e901b79f
Commit
e901b79f
authored
6 years ago
by
Owen Bush
Browse files
Options
Downloads
Patches
Plain Diff
Stop using drupal_set_message
parent
8dd3e476
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/recurring_events_registration/src/Form/RegistrantForm.php
+35
-2
35 additions, 2 deletions
...recurring_events_registration/src/Form/RegistrantForm.php
with
35 additions
and
2 deletions
modules/recurring_events_registration/src/Form/RegistrantForm.php
+
35
−
2
View file @
e901b79f
...
@@ -4,6 +4,9 @@ namespace Drupal\recurring_events_registration\Form;
...
@@ -4,6 +4,9 @@ namespace Drupal\recurring_events_registration\Form;
use
Drupal\Core\Entity\ContentEntityForm
;
use
Drupal\Core\Entity\ContentEntityForm
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Drupal\Core\Entity\EntityManagerInterface
;
use
Drupal\Core\Messenger\Messenger
;
/**
/**
* Form controller for Registrant edit forms.
* Form controller for Registrant edit forms.
...
@@ -12,6 +15,36 @@ use Drupal\Core\Form\FormStateInterface;
...
@@ -12,6 +15,36 @@ use Drupal\Core\Form\FormStateInterface;
*/
*/
class
RegistrantForm
extends
ContentEntityForm
{
class
RegistrantForm
extends
ContentEntityForm
{
/**
* The messenger service.
*
* @var \Drupal\Core\Messenger\Messenger
*/
protected
$messenger
;
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'entity.manager'
),
$container
->
get
(
'messenger'
)
);
}
/**
* Construct a EventSeriesForm.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager service.
* @param \Drupal\Core\Messenger\Messenger $messenger
* The messenger service.
*/
public
function
__construct
(
EntityManagerInterface
$entity_manager
,
Messenger
$messenger
)
{
$this
->
messenger
=
$messenger
;
parent
::
__construct
(
$entity_manager
);
}
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
@@ -34,13 +67,13 @@ class RegistrantForm extends ContentEntityForm {
...
@@ -34,13 +67,13 @@ class RegistrantForm extends ContentEntityForm {
switch
(
$status
)
{
switch
(
$status
)
{
case
SAVED_NEW
:
case
SAVED_NEW
:
drupal_set_m
essage
(
$this
->
t
(
'Created the %label Registrant.'
,
[
$this
->
messenger
->
addM
essage
(
$this
->
t
(
'Created the %label Registrant.'
,
[
'%label'
=>
$entity
->
label
(),
'%label'
=>
$entity
->
label
(),
]));
]));
break
;
break
;
default
:
default
:
drupal_set_m
essage
(
$this
->
t
(
'Saved the %label Registrant.'
,
[
$this
->
messenger
->
addM
essage
(
$this
->
t
(
'Saved the %label Registrant.'
,
[
'%label'
=>
$entity
->
label
(),
'%label'
=>
$entity
->
label
(),
]));
]));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment