12 const TABLE_NAME =
"NewsletterLog";
15 public $IdNewsletter = 0;
16 public $IdAccount = 0;
18 public $DateCreation =
"";
24 public function __construct($src = null, $stripSlashes =
false) {
30 $this->_loadByRow($src, $stripSlashes);
31 }
else if (is_numeric($src) && intval($src) > 0) {
33 $this->_loadFilter(self::GetTableName(__CLASS__),
"Id = " . intval($src));
47 public static function Load ($idNewsletter, $limit = null, $offset = null, &$count = null, $returnArray =
false) {
48 $where = sprintf(
"IdNewsletter = %d", $idNewsletter);
49 return self::_load(self::GetTableName(__CLASS__), ($returnArray ?
"" : __CLASS__), $where, NULL, $limit, $offset, $count);
61 $this->DateCreation = date(
"Y-m-d H:i:s");
62 $query = sprintf(
"INSERT INTO %s (IdNewsletter, IdAccount, Sent, DateCreation, Message) VALUES (%d, %d, %d, %s, '%s')",
63 self::GetTableName(__CLASS__),
67 $Database->EscapeDate($this->DateCreation),
68 $Database->Escape($this->Message));
69 if ($Database->Query($query)) {
71 $this->Id = $Database->InsertedId();
85 return $this->_Delete(self::GetTableName(__CLASS__),
"Id = " . $this->Id);
static Load($idNewsletter, $limit=null, $offset=null, &$count=null, $returnArray=false)
__construct($src=null, $stripSlashes=false)