Add column that enables/disables the form
[MAILPOET-3075]
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace MailPoet\Config;
|
namespace MailPoet\Config;
|
||||||
|
|
||||||
|
use MailPoet\Entities\FormEntity;
|
||||||
use MailPoet\Models\Newsletter;
|
use MailPoet\Models\Newsletter;
|
||||||
use MailPoet\Models\Subscriber;
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Settings\SettingsController;
|
use MailPoet\Settings\SettingsController;
|
||||||
@@ -385,6 +386,7 @@ class Migrator {
|
|||||||
$attributes = [
|
$attributes = [
|
||||||
'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
|
'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
|
||||||
'name varchar(90) NOT NULL,', // should be null but db_delta can't handle this change
|
'name varchar(90) NOT NULL,', // should be null but db_delta can't handle this change
|
||||||
|
'status varchar(20) NOT NULL DEFAULT "' . FormEntity::STATUS_ENABLED . '",',
|
||||||
'body longtext,',
|
'body longtext,',
|
||||||
'settings longtext,',
|
'settings longtext,',
|
||||||
'styles longtext,',
|
'styles longtext,',
|
||||||
|
@@ -24,6 +24,9 @@ class FormEntity {
|
|||||||
const DISPLAY_TYPE_SLIDE_IN = 'slide_in';
|
const DISPLAY_TYPE_SLIDE_IN = 'slide_in';
|
||||||
const DISPLAY_TYPE_OTHERS = 'others';
|
const DISPLAY_TYPE_OTHERS = 'others';
|
||||||
|
|
||||||
|
const STATUS_ENABLED = 'enabled';
|
||||||
|
const STATUS_DISABLED = 'disabled';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string")
|
* @ORM\Column(type="string")
|
||||||
* @var string
|
* @var string
|
||||||
@@ -36,6 +39,12 @@ class FormEntity {
|
|||||||
*/
|
*/
|
||||||
private $body;
|
private $body;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string")
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="serialized_array")
|
* @ORM\Column(type="serialized_array")
|
||||||
* @var array|null
|
* @var array|null
|
||||||
@@ -50,6 +59,7 @@ class FormEntity {
|
|||||||
|
|
||||||
public function __construct($name) {
|
public function __construct($name) {
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
$this->status = self::STATUS_ENABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user