public function __construct($data = array()) { parent::__construct('#__newsletter_automailings', 'automailing_id', JFactory::getDbo()); if (!empty($data)) { foreach ($data as $key => $value) { $this->{$key} = $value; } } }
public function __construct($data = array()) { $data = (array) $data; parent::__construct('#__newsletter_threads', 'thread_id', JFactory::getDbo()); /** Populate the entity */ foreach ($data as $key => &$value) { $this->{$key} = $value; } }
/** * Post-load processing. Decode password. * * @param type $keys * @param type $reset * @return type */ public function load($keys = null, $reset = true) { if (!parent::load($keys, $reset)) { return false; } if (!empty($this->password)) { $this->password = base64_decode($this->password); } if (!empty($this->data)) { $this->data = (array) json_decode($this->data); } return true; }
/** * The constructor of a class. * * @param object $config An object of configuration settings. * * @return void * @since 1.0 */ public function __construct(&$_db) { parent::__construct('#__extensions', 'extension_id', $_db); }
/** * The constructor of a class. * * @param object $config An object of configuration settings. * * @return void * @since 1.0 */ function __construct(&$_db) { parent::__construct('#__newsletter_smtp_profiles', 'smtp_profile_id', $_db); }
/** * The constructor of a class. * * @param object $config An object of configuration settings. * * @return void * @since 1.0 */ function __construct(&$_db) { parent::__construct('#__newsletter_newsletters_ext', 'newsletters_ext_id', $_db); }
/** * The constructor of a class. * * @param object $config An object of configuration settings. * * @return void * @since 1.0 */ function __construct(&$_db) { parent::__construct('#__newsletter_logs', 'log_id', $_db); }
/** * Overriden JTable::store to set created/modified and user id. * * @param boolean True to update fields even if they are null. * * @return boolean True on success. * @since 1.0 */ public function store($updateNulls = false) { $date = JFactory::getDate(); $user = JFactory::getUser(); // Verify that the alias is unique $table = JTable::getInstance('Template', 'NewsletterTable'); if (isset($this->name)) { if ($table->load(array('name' => $this->name))) { $this->setError(JText::_('COM_NEWSLETTER_DATABASE_ERROR_SUBSCRIBER_UNIQUE_NAME')); return false; } } return parent::store($updateNulls); }