Listing Handler

- added a Listing Handler class to take care of listing params
- added status column to Subscriber
- added specific methods to both Newsletter & Subscriber models for listing
This commit is contained in:
Jonathan Labreuille
2015-09-02 14:47:18 +02:00
parent 12a664f44e
commit 3fe895a7fe
7 changed files with 153 additions and 120 deletions

View File

@@ -44,9 +44,10 @@ class Migrator {
'first_name tinytext NOT NULL,',
'last_name tinytext NOT NULL,',
'email varchar(150) NOT NULL,',
'status tinyint(1) NOT NULL DEFAULT 0,',
'created_at TIMESTAMP NOT NULL DEFAULT 0,',
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
'PRIMARY KEY (id),',
'PRIMARY KEY (id),',
'UNIQUE KEY email (email)'
);
return $this->sqlify(__FUNCTION__, $attributes);
@@ -59,7 +60,7 @@ class Migrator {
'value varchar(255) NOT NULL,',
'created_at TIMESTAMP NOT NULL DEFAULT 0,',
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
'PRIMARY KEY (id),',
'PRIMARY KEY (id),',
'UNIQUE KEY name (name)'
);
return $this->sqlify(__FUNCTION__, $attributes);
@@ -72,7 +73,7 @@ class Migrator {
'body longtext,',
'created_at TIMESTAMP NOT NULL DEFAULT 0,',
'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
'PRIMARY KEY (id)'
'PRIMARY KEY (id)'
);
return $this->sqlify(__FUNCTION__, $attributes);
}