* @license PHP License * @package WB */ /** * Load classes */ WBClass::load(); /** * Wombat Newsletter System * * @version 1.5.1 * @package WB */ class WBDatasource_Newsletter extends WBStdClass { const TABLE_TRACKLINK = 'tracklink'; const TABLE_LINKTRACKING = 'linktracking'; const TABLE_SUBSCRIBER = 'newslettersubscriber'; const TABLE_SUBSCRIBERMANDATOR = 'newslettersubscribermandator'; const TABLE_SUBSCRIBERSOURCE = 'newslettersubscribersource'; const TABLE_SUBSCRIBERSENT = 'newslettersubscribersent'; const TABLE_NEWSLETTERTOPIC = 'newslettertopic'; const TABLE_NEWSLETTERGENERICSOURCE = 'newslettergenericsource'; const TABLE_NEWSLETTERISSUETOPIC = 'newsletterissuetopic'; const TABLE_NEWSLETTERSUBSCRIBERTOPIC = 'newslettersubscribertopic'; const TABLE_NEWSLETTERISSUE = 'newsletterissue'; const TABLE_NEWSLETTERISSUETRACKLINK = 'newsletterissuetracklink'; const TABLE_NEWSLETTERARTICLE = 'newsletterarticle'; const TABLE_NEWSLETTERISSUEARTICLE = 'newsletterissuearticle'; /* * Available newsletter subscriber send status */ const SEND_STATUS_UNKOWN = 'unknown'; const SEND_STATUS_SENT = 'sent'; const SEND_STATUS_FAILED = 'failed'; const SEND_STATUS_RETURNED = 'returned'; /** * Database Access * * @var WBDatasource_Table */ protected $table; /** * configuration * * @var WBConfig */ protected $config; /** * Constructor * * @param array */ final public function __construct($parameter = array()) { $this->table = WBClass::create('WBDatasource_Table'); $this->config = WBClass::create('WBConfig'); $this->config->load('newsletter/config'); $this->init($parameter); } /** * Return Config Values * * @see WBConfig::get() * @param string configuration path * @param mixed default value * @return array */ public function getConfig($path = '', $default = null) { if (empty($path)) { $path = ''; } return $this->config->get($path, $default); } /** * Get List Of Available Newsletter Languages * * @return array */ public function getAvailableLanguages() { $def = array('en_GB'); $available = $this->config->get('lang/available', $def); if (!is_array($available)) { return $def; } return $available; } /** * 2nd Constructor * * @param array */ protected function init($parameter = array()) { } }