You are here

protected function CalendarEventEmbeddedWidget::isCalendarEventPopulated in Opigno calendar event 8

Same name in this branch
  1. 8 src/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\CalendarEventEmbeddedWidget::isCalendarEventPopulated()
  2. 8 src/Form/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\Form\CalendarEventEmbeddedWidget::isCalendarEventPopulated()
Same name and namespace in other branches
  1. 3.x src/CalendarEventEmbeddedWidget.php \Drupal\opigno_calendar_event\CalendarEventEmbeddedWidget::isCalendarEventPopulated()

Checks whether the calendar event widget is populated.

Parameters

\Drupal\opigno_calendar_event\CalendarEventInterface $calendar_event: A calendar event entity built from the related submitted values.

Return value

bool TRUE if the widget was populated, FALSE otherwise.

2 calls to CalendarEventEmbeddedWidget::isCalendarEventPopulated()
CalendarEventEmbeddedWidget::submitForm in src/CalendarEventEmbeddedWidget.php
Submit handler.
CalendarEventEmbeddedWidget::validateForm in src/CalendarEventEmbeddedWidget.php
Validation handler.

File

src/CalendarEventEmbeddedWidget.php, line 425

Class

CalendarEventEmbeddedWidget
Provides a widget to attach a calendar event to an entity.

Namespace

Drupal\opigno_calendar_event

Code

protected function isCalendarEventPopulated(CalendarEventInterface $calendar_event) {
  return $calendar_event
    ->isDisplayed() || !$calendar_event
    ->getDateItems()
    ->isEmpty();
}