Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11 - Add a relation between events and locations #16

Open
wants to merge 1 commit into
base: assignment/10
Choose a base branch
from

Conversation

luca-rath
Copy link
Contributor

@luca-rath luca-rath commented Jul 7, 2020

Add a association between events and locations

Goal

After implementing the location management functionality in the Sulu administration interface, we want to add an
association between the Event entity and the Location entity. With this assignment we are completing our goal of
removing redundant location information inside of different events.

Steps

  • Add a many-to-one association between the Event entity and the Location entity
  • Don't forget to update your database schema with bin/adminconsole doctrine:schema:update --force
  • Serialize the id of the associated location of an event as locationId (will be used in the controller afterwards)
  • Add the logic for setting and modifying the locationId property in your src/Controller/EventController.php
  • Configure a new single_location_selection field type in your config/packages/sulu_admin.yaml
  • Add a property locationId with the type single_location_selection to your event_details form
  • Log into the admin UI with user "admin" and password "admin"
  • Navigate to an event and select one of your locations

Hints

  • Run bin/adminconsole doctrine:schema:validate
  • Run bin/adminconsole debug:config sulu_admin field_type_options.single_selection to get some insights on how to
    configure a single selection field type.

More Information

If you want to select a custom entity somewhere in your form, you need to use a respective field type for this
property. To simplify this process for the developer, Sulu includes an abstract selection and single_selection
field type. These abstract field types can be instantiated for your custom entity by providing respective
field_type_options in the configuration of your application.

Links

@alexander-schranz alexander-schranz added the assignment Pull request for a assignment solution label Sep 23, 2020
@niklasnatter niklasnatter force-pushed the assignment/11 branch 2 times, most recently from 58ef1d6 to 90219e8 Compare October 21, 2020 09:32
@niklasnatter niklasnatter force-pushed the assignment/11 branch 2 times, most recently from b18cd02 to 5619364 Compare October 23, 2020 11:30
@niklasnatter niklasnatter force-pushed the assignment/11 branch 4 times, most recently from bf0011e to 636e0fb Compare February 16, 2021 14:23
@niklasnatter niklasnatter force-pushed the assignment/11 branch 2 times, most recently from 53bc591 to f27b7b7 Compare May 27, 2021 13:01
@niklasnatter niklasnatter force-pushed the assignment/11 branch 4 times, most recently from 611bf1a to f739c78 Compare June 22, 2021 08:58
@niklasnatter niklasnatter force-pushed the assignment/10 branch 3 times, most recently from 150b891 to 85eb9ea Compare June 20, 2022 20:39
@niklasnatter niklasnatter force-pushed the assignment/11 branch 2 times, most recently from 1446313 to 83977e6 Compare June 20, 2022 21:12
@niklasnatter niklasnatter force-pushed the assignment/11 branch 2 times, most recently from 105a116 to 4eb2a81 Compare June 20, 2022 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assignment Pull request for a assignment solution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants