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 ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
<?php
namespace HiEvents\DomainObjects;
use HiEvents\DomainObjects\Interfaces\IsFilterable;
use HiEvents\DomainObjects\Interfaces\IsSortable;
use HiEvents\DomainObjects\SortingAndFiltering\AllowedSorts;
use HiEvents\Helper\StringHelper;
class MessageDomainObject extends Generated\MessageDomainObjectAbstract implements IsSortable, IsFilterable
{
private ?UserDomainObject $sentByUser = null;
public static function getDefaultSort(): string
{
return self::CREATED_AT;
}
public static function getDefaultSortDirection(): string
{
return 'asc';
}
public static function getAllowedSorts(): AllowedSorts
{
return new AllowedSorts(
[
self::CREATED_AT => [
'asc' => __('Sent Date Oldest'),
'desc' => __('Sent Date Newest'),
],
self::SUBJECT => [
'asc' => __('Subject A-Z'),
'desc' => __('Subject Z-A'),
],
],
);
}
public static function getAllowedFilterFields(): array
{
return [
self::STATUS,
];
}
public function getSentByUser(): ?UserDomainObject
{
return $this->sentByUser;
}
public function setSentByUser(UserDomainObject $user): self
{
$this->sentByUser = $user;
return $this;
}
public function getMessagePreview(): string
{
return StringHelper::previewFromHtml($this->getMessage());
}
}