Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

579 B
Raw Blame
<?php

namespace HiEvents\DomainObjects;

use HiEvents\DomainObjects\Status\AccountSubscriptionStatus;

class AccountSubscriptionDomainObject extends Generated\AccountSubscriptionDomainObjectAbstract
{
    public function grantsAccess(): bool
    {
        return $this->status()?->grantsAccess() ?? false;
    }

    public function hasOpenSubscription(): bool
    {
        return $this->status()?->isOpen() ?? false;
    }

    private function status(): ?AccountSubscriptionStatus
    {
        return AccountSubscriptionStatus::tryFrom((string) $this->getStatus());
    }
}