diff --git a/source/_zets/32.md b/source/_zets/32.md new file mode 100644 index 000000000..89d9beb75 --- /dev/null +++ b/source/_zets/32.md @@ -0,0 +1,60 @@ +--- +title: Drupal Bundle classes +date: 2025-07-12 23:25:52 +tags: + - drupal + - php +--- + +By overridding a given bundle type: + +```php +get('field_date')->value; + } + + public function getEventName(): string { + /** @var non-empty-string */ + return $this->get('field_event_name')->value; + } + + public function isPast(): bool { + return $this->getEventDate() < strtotime('today'); + } + +} +```