Diff #4 - trunk/src/Models/EmailNotification.php
1,395 bytes
|
|
January 20, 2025 at 08:20
|
Diff
Index: EmailNotification.php
--- EmailNotification.php (nonexistent) +++ EmailNotification.php (revision 4) @@ -0,0 +1,56 @@ +<?php +declare(strict_types = 1); + +namespace App\Webapp\Models; + +use Apex\App\Base\Model\MagicModel; +use App\Webapp\Models\EmailAttachment; +use Apex\App\Base\Model\ModelIterator; +use DateTime; + +/** + * EmailNotification Model + */ +class EmailNotification extends MagicModel +{ + + /** + * Database table + * + * @var string + */ + protected static string $dbtable = 'internal_email_notifications'; + + /** + * Constructor + */ + public function __construct( + protected int $id, + protected bool $is_active = true, + protected string $controller = '', + protected string $alias = '', + protected string $sender = '', + protected string $recipient = '', + protected string $reply_to = '', + protected string $cc = '', + protected string $bcc = '', + protected string $subject = '', + protected string $text_contents = '', + protected string $html_contents = '', + protected string $condition_vars = '' + ) { + + } + + /** + * Get attachments + */ + public function getAttachments(string $sort_by = '', string $sort_dir = '', int $limit = 0, int $offset = 0):ModelIterator + { + $result = $this->getChildren('internal_email_notifications_attachments.notification_id', EmailAttachment::class, $sort_by, $sort_dir, $limit, $offset); + return $result; + } + + +} +
Full Code
<?php declare(strict_types = 1);
namespace App\Webapp\Models;
use Apex\App\Base\Model\MagicModel; use App\Webapp\Models\EmailAttachment; use Apex\App\Base\Model\ModelIterator; use DateTime;
/** * EmailNotification Model */ class EmailNotification extends MagicModel {
/**
* Database table
*
* @var string
*/
protected static string $dbtable = 'internal_email_notifications';
/**
* Constructor
*/
public function __construct(
protected int $id,
protected bool $is_active = true,
protected string $controller = '',
protected string $alias = '',
protected string $sender = '',
protected string $recipient = '',
protected string $reply_to = '',
protected string $cc = '',
protected string $bcc = '',
protected string $subject = '',
protected string $text_contents = '',
protected string $html_contents = '',
protected string $condition_vars = ''
) {
}
/**
* Get attachments
*/
public function getAttachments(string $sort_by = '', string $sort_dir = '', int $limit = 0, int $offset = 0):ModelIterator
{
$result = $this->getChildren('internal_email_notifications_attachments.notification_id', EmailAttachment::class, $sort_by, $sort_dir, $limit, $offset);
return $result;
}
}