getPersistence()->getPlatForm(); return [ self::NOTIFICATION_FIELD_RECIPIENT => $notification->getRecipient(), self::NOTIFICATION_FIELD_STATUS => $notification->getStatus(), self::NOTIFICATION_FIELD_SENDER => $notification->getSenderId(), self::NOTIFICATION_FIELD_SENDER_NAME => $notification->getSenderName(), self::NOTIFICATION_FIELD_TITLE => $notification->getTitle(), self::NOTIFICATION_FIELD_MESSAGE => $notification->getMessage(), self::NOTIFICATION_FIELD_CREATION => $platform->getNowExpression(), self::NOTIFICATION_FIELD_UPDATED => $platform->getNowExpression(), ]; } /** * Allows a class to adapt the schemas as required * * @param SchemaCollection $schemaCollection * * @throws common_exception_InconsistentData */ public function provideSchema(SchemaCollection $schemaCollection): void { $schema = $schemaCollection->getSchema($this->getOption(self::OPTION_PERSISTENCE)); $queueTable = $schema->createTable(self::NOTIFICATION_TABLE); $queueTable->addOption('engine', 'MyISAM'); $queueTable->addColumn(self::NOTIFICATION_FIELD_ID, 'integer', ['notnull' => true, 'autoincrement' => true]); $queueTable->addColumn(self::NOTIFICATION_FIELD_RECIPIENT, 'string', ['notnull' => true, 'length' => 255]); $queueTable->addColumn(self::NOTIFICATION_FIELD_STATUS, 'integer', ['default' => 0, 'notnull' => false, 'length' => 255]); $queueTable->addColumn(self::NOTIFICATION_FIELD_TITLE, 'string', ['length' => 255]); $queueTable->addColumn(self::NOTIFICATION_FIELD_MESSAGE, 'text', ['default' => null]); $queueTable->addColumn(self::NOTIFICATION_FIELD_SENDER, 'string', ['default' => null, 'notnull' => false, 'length' => 255]); $queueTable->addColumn(self::NOTIFICATION_FIELD_SENDER_NAME, 'string', ['default' => null, 'notnull' => false, 'length' => 255]); $queueTable->addColumn(self::NOTIFICATION_FIELD_CREATION, 'datetime', ['notnull' => true]); $queueTable->addColumn(self::NOTIFICATION_FIELD_UPDATED, 'datetime', ['notnull' => true]); $queueTable->setPrimaryKey([self::NOTIFICATION_FIELD_ID]); } }