Diff
Index: EmailAttachment.php
--- EmailAttachment.php (nonexistent)
+++ EmailAttachment.php (revision 4)
@@ -0,0 +1,47 @@
+<?php
+declare(strict_types = 1);
+
+namespace App\Webapp\Models;
+
+use Apex\App\Base\Model\MagicModel;
+use App\Webapp\Models\EmailNotification;
+use DateTime;
+
+/**
+ * InternalEmailNotificationsAttachment Model
+ */
+class EmailAttachment extends MagicModel
+{
+
+ /**
+ * Database table
+ *
+ * @var string
+ */
+ protected static string $dbtable = 'internal_email_notifications_attachments';
+
+ /**
+ * Constructor
+ */
+ public function __construct(
+ protected int $id,
+ protected int $notification_id,
+ protected string $filename,
+ protected int $filesize,
+ protected string $contents
+ ) {
+
+ }
+
+ /**
+ * Get Notification Id
+ */
+ public function getNotification():EmailNotification
+ {
+ $obj = EmailNotification::whereId($this->notification_id);
+ return $obj;
+ }
+
+
+}
+
Full Code
<?php
declare(strict_types = 1);
namespace App\Webapp\Models;
use Apex\App\Base\Model\MagicModel;
use App\Webapp\Models\EmailNotification;
use DateTime;
/**
* InternalEmailNotificationsAttachment Model
*/
class EmailAttachment extends MagicModel
{
/**
* Database table
*
* @var string
*/
protected static string $dbtable = 'internal_email_notifications_attachments';
/**
* Constructor
*/
public function __construct(
protected int $id,
protected int $notification_id,
protected string $filename,
protected int $filesize,
protected string $contents
) {
}
/**
* Get Notification Id
*/
public function getNotification():EmailNotification
{
$obj = EmailNotification::whereId($this->notification_id);
return $obj;
}
}