Wrap calls in DateTime and Emoji classes

This commit is contained in:
Amine Ben hammou
2019-01-23 16:43:12 +01:00
parent 06f1dad120
commit d452cfcae7
7 changed files with 81 additions and 47 deletions

View File

@@ -41,11 +41,14 @@ class Newsletter extends Model {
// automatic newsletters status
const STATUS_ACTIVE = 'active';
private $emoji;
function __construct() {
parent::__construct();
$this->addValidations('type', array(
'required' => __('Please specify a type.', 'mailpoet')
));
$this->emoji = new Emoji();
}
function queue() {
@@ -105,7 +108,7 @@ class Newsletter extends Model {
}
$this->set(
'body',
Emoji::encodeForUTF8Column(self::$_table, 'body', $this->body)
$this->emoji->encodeForUTF8Column(self::$_table, 'body', $this->body)
);
}