create event programatically

  • Enrique Alvarez
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #149341 by Enrique Alvarez
create event programatically was created by Enrique Alvarez
Hi, 
is it possible to create an event programmatically?
In other words, a different extension of Joomla executes a PHP snippet code that creates an event using the capabilities of 'Events booking'

Thanks

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #149354 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic create event programatically
Having new year holiday in our country at the moment, so I could not test it carefully. However, I think something like below should work:
Code:
require_once JPATH_ADMINISTRATOR . '/components/com_eventbooking/libraries/rad/bootstrap.php'; $data = [ 'title' => 'Event Title', 'event_date' => '2022-12-01', 'main_category_id' => 10, 'price' => 100, 'short_description' => 'Short Description Of Event', 'description' => 'Description Of Event', ]; $input = new RADInput($data); JLoader::register('EventbookingModelEvent', JPATH_ADMINISTRATOR . '/components/com_eventbooking/model/event.php'); /* @var EventbookingModelEvent $model */ $model = RADModel::getTempInstance('Event', 'EventbookingModel'); $model->store($input);

Please Log in or Create an account to join the conversation.

  • Enrique Alvarez
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 months ago #149360 by Enrique Alvarez
Replied by Enrique Alvarez on topic create event programatically
happy holidays!

that's great,
- can you add a photo to the event with this?
- and an organizer?

We would like our organizer to be able to see the list of registrants and to send emails and communicate. Would that be possible with your solution?

Thanks

Please Log in or Create an account to join the conversation.

More
3 years 2 months ago #149477 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic create event programatically
Hello Enrique

1. You cannot add photo to event because we do not have code to handle upload and resize images by passing data like that.

2. For organizer, we do not have organizer concept in the extension. So this is not possible, too

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc