class CalendarEvent in Calendar 8.2
Same name and namespace in other branches
- 8 src/CalendarEvent.php \Drupal\calendar\CalendarEvent
Defines a calendar event object.
Hierarchy
- class \Drupal\calendar\CalendarEvent
Expanded class hierarchy of CalendarEvent
1 file declares its use of CalendarEvent
- Calendar.php in src/
Plugin/ views/ style/ Calendar.php
File
- src/
CalendarEvent.php, line 8
Namespace
Drupal\calendarView source
class CalendarEvent {
/**
* Startdate for the event.
*
* @var \Drupal\Core\Datetime\DrupalDateTime
* The start date for the event.
*/
protected $startDate;
/**
* Enddate for the event.
*
* @var \Drupal\Core\Datetime\DrupalDateTime
* The end date for the event.
*/
protected $endDate;
/**
* The rendered row.
*
* @var array
* The rendered row.
*/
protected $row;
/**
* The granularity for the view display.
*
* @var string
* The granularity of this event (e.g. "day", "second").
*/
protected $granularity;
/**
* Allday events are defined as having starttime 00:00 and endtime 23:59.
*
* @var bool
* Defines whether or not this event's duration is all day.
*/
protected $allDay;
/**
* The timezone for the event as defined by its author.
*
* This needs a core patch to set this per entity.
*
* @var \DateTimeZone
* The timezone of the event.
*/
protected $timezone;
/**
* Stripelabels not used (yet).
*
* @var array
* The array of labels to be used for this stripe option.
*/
protected $stripeLabels;
/**
* Stripelabels not used (yet).
*
* @var string
* The hex code array of the color to be used.
*/
protected $stripeHexes;
/**
* Multiday events are defined as having startdate different from enddate.
*
* It takes timezone into account.
*
* @var bool
* Whether this event covers multiple days.
*/
protected $multiDay;
/**
* Entity.
*
* @var \Drupal\Core\Entity\ContentEntityInterface
*/
protected $entity;
/**
* Label.
*
* @var string
*/
protected $label;
/**
* Offset (necessary?).
*
* @var \DateInterval
*/
protected $offSet;
/**
* Length (necessary?).
*
* @var \DateInterval
*/
protected $length;
/**
* Event id.
*
* @var int
*/
protected $id;
/**
* Event weekno.
*
* @var int
*/
protected $weekno;
/**
* Event color.
*
* @var string
*/
protected $color;
/**
* Getter for weekno.
*
* @return int
* The getter to fetch the weekno.
*/
public function getWeekno() {
return $this->weekno;
}
/**
* Setter for the weekno.
*
* @param int $weekno
* The setter for the weekno.
*/
public function setWeekno(int $weekno) {
$this->weekno = $weekno;
}
/**
* Set a row as array with values (caldays).
*
* @param array $row
* The setter to attach the rendered row.
*/
public function setRow(array $row) {
$this->row = $row;
}
/**
* Get a row as array with values (caldays).
*
* @return array
* The getter to fetch the attached rendered row.
*/
public function getRow() {
return $this->row;
}
/**
* Getter for the event id.
*
* @return int
* The id for the event
*/
public function getId() {
return $this->id;
}
/**
* Setter for the event id.
*
* @@param int $id
* The event id is derived from related entity.
*/
public function setId($id) {
$this->id = $id;
}
/**
* Getter for the entity type id.
*
* @todo Remove for getType.
*
* @return string
* The entity type id.
*/
public function getEntityTypeId() {
return $this->entity
->getEntityTypeId();
}
/**
* Get the complete entity.
*
* @return \Drupal\Core\Entity\ContentEntityInterface
* Tthe event entity.
*/
public function getEntity() {
return $this->entity;
}
/**
* Getter for the type.
*
* @return string
* The type of the entity.
*/
public function getType() {
return $this->entity
->getEntityTypeId();
}
/**
* Getter the entity bundle.
*
* @return string
* The entity bundle.
*/
public function getBundle() {
return $this->entity
->bundle();
}
/**
* Getter for color.
*
* @return string
* The color of the entity.
*/
public function getColor() {
return $this->color;
}
/**
* Getter for the start date.
*
* @return \Drupal\Core\Datetime\DrupalDateTime
* The start date.
*/
public function getStartDate() {
return $this->startDate;
}
/**
* Setter for the start date.
*
* @param \Drupal\Core\Datetime\DrupalDateTime $startDate
* The start date.
*/
public function setStartDate($startDate) {
$this->startDate = $startDate;
}
/**
* Getter for the offset.
*
* @return \DateInterval
* The date offset.
*/
public function getOffset() {
return $this->offSet;
}
/**
* Setter for the offset.
*
* @param \DateInterval $offSet
* The offset date.
*/
public function setOffSet($offSet) {
$this->offSet = $offSet;
}
/**
* Getter for the length.
*
* @return \DateInterval
* The event length.
*/
public function getLength() {
return $this->length;
}
/**
* Setter for the length.
*
* @param \DateInterval $length;
* The event length.
*/
public function setLength($length) {
$this->length = $length;
}
/**
* Getter for the end date.
*
* @return \Drupal\Core\Datetime\DrupalDateTime
* The end date.
*/
public function getEndDate() {
return $this->endDate;
}
/**
* Setter for the end date.
*
* @param \Drupal\Core\Datetime\DrupalDateTime $endDate
* The end date.
*/
public function setEndDate($endDate) {
$this->endDate = $endDate;
}
/**
* Getter for the event granularity.
*
* @return string
* The event granularity.
*/
public function getGranularity() {
return $this->granularity;
}
/**
* Setter for the event granularity.
*
* @param string $granularity
* The event granularity.
*/
public function setGranularity($granularity) {
$this->granularity = $granularity;
}
/**
* Getter for the all day property.
*
* @return boolean
* TRUE if the event is all day, FALSE otherwise.
*/
public function getAllDay() {
return $this->allDay;
}
/**
* Setter for the all day property.
*
* @param bool $allDay
* TRUE if the event is all day, FALSE otherwise.
*/
public function setAllDay($allDay) {
$this->allDay = $allDay;
}
/**
* The getter which indicates whether an event covers multiple days.
*
* @return bool
* Bool TRUE if is multiday.
*/
public function getMultiDay() {
return $this->multiDay;
}
/**
* The setter to indicate whether an event covers multiple days.
*
* @param bool $multiDay
* TRUE if multiday.
*/
public function setMultiDay($multiDay) {
$this->multiDay = $multiDay;
}
/**
* Getter for the timezone property.
*
* @return \DateTimeZone
* The timezone of this event.
*/
public function getTimezone() {
return $this->timezone;
}
/**
* Setter for the timezone property.
*
* @param \DateTimeZone $timezone
* The timezone of this event.
*/
public function setTimezone($timezone) {
$this->timezone = $timezone;
}
/**
* The title setter.
*
* @param string $label
* The title of the event.
*/
public function setLabel($label) {
$this->label = $label;
}
/**
* The color setter.
*
* @@param string $color
* The title of the event.
*/
public function setColor($color) {
$this->color = $color;
}
/**
* The title getter.
*
* @return string
* The title of the event.
*/
public function getLabel() {
return $this->label;
}
/**
* Getter for the url.
*
* @return string
* The public url to this event.
*/
public function getUrl() {
return $this
->getUrl();
}
/**
* Getter for the stripe label array.
*
* If no array is defined, this initializes the variable to an empty array.
*
* @return array
* The stripe labels.
*/
public function getStripeLabels() {
if (!isset($this->stripeLabels)) {
$this->stripeLabels = [];
}
return $this->stripeLabels;
}
/**
* Setter for the stripe label array.
*
* @param string $stripeLabels
* The stripe labels.
*/
public function setStripeLabels($stripeLabels) {
$this->stripeLabels = $stripeLabels;
}
/**
* Getter for the stripe hex code array.
*
* If no array is defined, this initializes the variable to an empty array.
*
* @return array
* The stripe hex code array.
*/
public function getStripeHexes() {
if (!isset($this->stripeHexes)) {
$this->stripeHexes = [];
}
return $this->stripeHexes;
}
/**
* The setter for the stripe hex code array.
*
* @param string $stripeHexes
* The stripe hex code array.
*/
public function setStripeHexes($stripeHexes) {
$this->stripeHexes = $stripeHexes;
}
/**
* Add a single strip hex.
*
* @param string $stripeHex
*/
public function addStripeHex($stripeHex) {
$this->stripeHexes[] = $stripeHex;
}
/**
* Add a single strip label.
*
* @param string $stripeLabel
*/
public function addStripeLabel($stripeLabel) {
$this->stripeLabels[] = $stripeLabel;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CalendarEvent:: |
protected | property | Allday events are defined as having starttime 00:00 and endtime 23:59. | |
CalendarEvent:: |
protected | property | Event color. | |
CalendarEvent:: |
protected | property | Enddate for the event. | |
CalendarEvent:: |
protected | property | Entity. | |
CalendarEvent:: |
protected | property | The granularity for the view display. | |
CalendarEvent:: |
protected | property | Event id. | |
CalendarEvent:: |
protected | property | Label. | |
CalendarEvent:: |
protected | property | Length (necessary?). | |
CalendarEvent:: |
protected | property | Multiday events are defined as having startdate different from enddate. | |
CalendarEvent:: |
protected | property | Offset (necessary?). | |
CalendarEvent:: |
protected | property | The rendered row. | |
CalendarEvent:: |
protected | property | Startdate for the event. | |
CalendarEvent:: |
protected | property | Stripelabels not used (yet). | |
CalendarEvent:: |
protected | property | Stripelabels not used (yet). | |
CalendarEvent:: |
protected | property | The timezone for the event as defined by its author. | |
CalendarEvent:: |
protected | property | Event weekno. | |
CalendarEvent:: |
public | function | Add a single strip hex. | |
CalendarEvent:: |
public | function | Add a single strip label. | |
CalendarEvent:: |
public | function | Getter for the all day property. | |
CalendarEvent:: |
public | function | Getter the entity bundle. | |
CalendarEvent:: |
public | function | Getter for color. | |
CalendarEvent:: |
public | function | Getter for the end date. | |
CalendarEvent:: |
public | function | Get the complete entity. | |
CalendarEvent:: |
public | function | Getter for the entity type id. | |
CalendarEvent:: |
public | function | Getter for the event granularity. | |
CalendarEvent:: |
public | function | Getter for the event id. | |
CalendarEvent:: |
public | function | The title getter. | |
CalendarEvent:: |
public | function | Getter for the length. | |
CalendarEvent:: |
public | function | The getter which indicates whether an event covers multiple days. | |
CalendarEvent:: |
public | function | Getter for the offset. | |
CalendarEvent:: |
public | function | Get a row as array with values (caldays). | |
CalendarEvent:: |
public | function | Getter for the start date. | |
CalendarEvent:: |
public | function | Getter for the stripe hex code array. | |
CalendarEvent:: |
public | function | Getter for the stripe label array. | |
CalendarEvent:: |
public | function | Getter for the timezone property. | |
CalendarEvent:: |
public | function | Getter for the type. | |
CalendarEvent:: |
public | function | Getter for the url. | |
CalendarEvent:: |
public | function | Getter for weekno. | |
CalendarEvent:: |
public | function | Setter for the all day property. | |
CalendarEvent:: |
public | function | The color setter. | |
CalendarEvent:: |
public | function | Setter for the end date. | |
CalendarEvent:: |
public | function | Setter for the event granularity. | |
CalendarEvent:: |
public | function | Setter for the event id. | |
CalendarEvent:: |
public | function | The title setter. | |
CalendarEvent:: |
public | function | Setter for the length. | |
CalendarEvent:: |
public | function | The setter to indicate whether an event covers multiple days. | |
CalendarEvent:: |
public | function | Setter for the offset. | |
CalendarEvent:: |
public | function | Set a row as array with values (caldays). | |
CalendarEvent:: |
public | function | Setter for the start date. | |
CalendarEvent:: |
public | function | The setter for the stripe hex code array. | |
CalendarEvent:: |
public | function | Setter for the stripe label array. | |
CalendarEvent:: |
public | function | Setter for the timezone property. | |
CalendarEvent:: |
public | function | Setter for the weekno. |