/** * Get a connection table object * * @param int $id connection id * * @return object connection tables */ public function &getConnection($id = null) { if (!is_null($id)) { $this->setId($id); } if (!is_object($this->_connection)) { $session = JFactory::getSession(); $key = 'fabrik.connection.' . $this->_id; if ($session->has($key)) { $connProperties = unserialize($session->get($key)); // $$$ rob since J1.6 - connection properties stored as an array (in f2 it was an object) if (is_a($connProperties, '__PHP_Incomplete_Class') || JArrayHelper::getValue($connProperties, 'id') == '') { $session->clear($key); } else { $this->_connection = FabTable::getInstance('connection', 'FabrikTable'); $this->_connection->bind($connProperties); return $this->_connection; } } if ($this->_id == -1 || $this->_id == '') { $this->_connection = $this->loadDefaultConnection(); } else { $this->_connection = FabTable::getInstance('Connection', 'FabrikTable'); $this->_connection->load($this->_id); } // $$$ rob store the connection for later use as it may be required by modules/plugins $session->set($key, serialize($this->_connection->getProperties())); } return $this->_connection; }
/** * Load the audience for a publication by version id * * @param integer $versionid Pub version ID * @return mixed False if error, Object on success */ public function loadByVersion($versionid = NULL) { if ($versionid === NULL) { return false; } return parent::load(array('publication_version_id' => (int) $versionid)); }
/** * Method to load a row from the database by primary key and bind the fields * to the JTable instance properties. * * @param mixed $keys An optional primary key value to load the row by, or an array of fields to match. If not * set the instance property value is used. * @param boolean $reset True to reset the default values before loading the new row. * * @return boolean True if successful. False if row not found or on error (internal error state set in that case). * * @link http://docs.joomla.org/JTable/load * @since 11.1 */ public function load($keys = null, $reset = true) { parent::load($keys, $reset); $this->slug = $this->id . "." . $this->alias; // Calculate funded percent if (!$this->goal) { $this->fundedPercent = 0; } else { $percentage = new Prism\Math(); $percentage->calculatePercentage($this->funded, $this->goal, 0); $this->fundedPercent = (string) $percentage; } // Calculate end date if (!empty($this->funding_days)) { $fundingStartDateValidator = new Prism\Validator\Date($this->funding_start); if (!$fundingStartDateValidator->isValid()) { $this->funding_end = "0000-00-00"; } else { $fundingStartDate = new Crowdfunding\Date($this->funding_start); $fundingEndDate = $fundingStartDate->calculateEndDate($this->funding_days); $this->funding_end = $fundingEndDate->toSql(); } } // Calculate days left $today = new Crowdfunding\Date(); $this->daysLeft = $today->calculateDaysLeft($this->funding_days, $this->funding_start, $this->funding_end); return true; }
function load($id = null) { parent::load($id); jimport('joomla.html.parameter'); $params = new JParameter($this->settings); $this->settings = $params->toArray(); }
/** * Method to load a row from the database by primary key and bind the fields * to the JTable instance properties. * * @param mixed $keys An optional primary key value to load the row by, or an array of fields to match. If not set the instance property value is used. * @param boolean $reset True to reset the default values before loading the new row. * @return boolean True if successful. False if row not found or on error (internal error state set in that case). */ public function load($keys = null, $reset = true) { if (is_numeric($keys)) { return parent::load($keys, $reset); } return parent::load(array('alias' => $keys), $reset); }
public function load($key = null, $permalink = false) { static $loaded = array(); $sig = $key . (int) $permalink; $doBind = true; if (!isset($loaded[$sig])) { if (!$permalink) { parent::load($key); $loaded[$sig] = $this; //return $this->id; } else { $db = DiscussHelper::getDBO(); $query = 'SELECT ' . $db->nameQuote('id') . ' FROM ' . $db->nameQuote($this->_tbl) . ' ' . 'WHERE ' . $db->nameQuote('alias') . '=' . $db->Quote($key); $db->setQuery($query); $id = $db->loadResult(); // Try replacing ':' to '-' since Joomla replaces it if (!$id) { $query = 'SELECT id FROM ' . $this->_tbl . ' ' . 'WHERE alias=' . $db->Quote(JString::str_ireplace(':', '-', $key)); $db->setQuery($query); $id = $db->loadResult(); } parent::load($id); $loaded[$sig] = $this; } $doBind = false; } if ($doBind) { return parent::bind($loaded[$sig]); } else { return $this->id; } }
/** * Get db row/item loaded with id * * @return JTable */ protected function getRow() { if (!isset($this->row)) { $this->row = $this->getTable($this->_type); $this->row->load($this->id); } return $this->row; }
/** * Test the publish method. * * @return void * * @since 12.3 */ public function testPublish() { $this->object->publish(array(array('id1' => 25, 'id2' => 50), array('id1' => 25, 'id2' => 51)), 2); $this->object->load(array('id1' => 25, 'id2' => 50)); $this->assertEquals(2, $this->object->published); $this->object->load(array('id1' => 25, 'id2' => 51)); $this->assertEquals(2, $this->object->published); }
/** * Load by post id. Return Only ONE latest record */ public function load($keys = null, $reset = true) { $db = DiscussHelper::getDBO(); $query = 'SELECT id FROM `#__discuss_assignment_map` WHERE `post_id` = ' . $db->quote($keys) . ' ORDER BY `created` DESC LIMIT 0, 1'; $db->setQuery($query); $result = $db->loadResult(); return parent::load($result, $reset); }
public function load($oid = null) { $ret = parent::load($oid); if ($ret === true) { $this->_exists = true; } return $ret; }
public function load($keys = null, $reset = true) { if (K2_JVERSION == '15') { return parent::load($keys); } else { return parent::load($keys, $reset); } }
/** * Load a record and bind to $this * * @param integer $response_id Answer ID * @param string $ip IP address * @return boolean True upon success, False if errors */ public function loadByIp($response_id = null, $ip = null) { $response_id = $response_id ?: $this->response_id; if ($response_id == null) { return false; } return parent::load(array('response_id' => (int) $response_id, 'ip' => (string) $ip)); }
/** * Override parent's load behavior as we need to attach messageTable here. * * @since 3.0 * @access public */ public function load($id = null, $ignore = array()) { $state = parent::load($id); if (!$state) { return $state; } return $state; }
/** * Method to load a row from the database by primary key and bind the fields * to the JTable instance properties. * * @param mixed $keys An optional primary key value to load the row by, or an array of fields to match. If not * set the instance property value is used. * @param boolean $reset True to reset the default values before loading the new row. * * @return boolean True if successful. False if row not found. * * @link http://docs.joomla.org/JTable/load * @since 11.1 * @throws RuntimeException * @throws UnexpectedValueException */ public function load($keys = null, $reset = true) { $result = parent::load($keys, $reset); if ($result) { $this->tags = new JHelperTags(); $this->tags->getTagIds($this->id, 'com_webgallery.item'); } return $result; }
function load($oid = null) { $ret = parent::load($oid); if ($ret === true) { $this->_exists = true; } $this->userid = (int) $oid; return $ret; }
public function load($pk = null, $reset = true) { if (parent::load($pk, $reset)) { $this->{'type_' . $this->type} = $this->default_values; return true; } else { return false; } }
/** * Load a record by message ID and user ID and bind to $this * * @param integer $mid Message ID * @param integer $uid User ID * @return boolean True on success */ public function loadRecord($mid = null, $uid = null) { $mid = $mid ?: $this->mid; $uid = $uid ?: $this->uid; if (!$mid || !$uid) { return false; } return parent::load(array('mid' => $mid, 'uid' => $uid)); }
public function load($keys = null, $reset = true) { $result = parent::load($keys, $reset); if (isset($this->password) && !empty($this->password)) { $cryptor = new JSimpleCrypt(); $this->password = $cryptor->decrypt($this->password); } return $result; }
/** * Get group table * * @return FabrikTableGroup */ public function &getGroup() { if (is_null($this->group)) { JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fabrik/tables'); $this->group = FabTable::getInstance('Group', 'FabrikTable'); $this->group->load($this->getId()); } return $this->group; }
function load($id = 0) { parent::load($id); /*$db = JFactory::getDBO(); $sql = "SELECT catid FROM #__digicom_product_categories WHERE productid='".$this->id."'"; $db->setQuery($sql); $this->selection = $db->loadColumn(); */ $this->selection = $this->catid; }
/** * Load a record and bind to $this * * @param mixed $keys Alias or ID * @param inteher $pageid Parent page ID * @return boolean True on success */ public function load($oid = NULL, $pageid = NULL) { if ($oid === NULL) { return false; } if (is_string($oid)) { return parent::load(array('filename' => $oid, 'pageid' => $pageid)); } return parent::load($oid); }
/** * Load entry * * @param integer $vid pub version id * @param integer $group_id group id * @return object or FALSE */ public function loadEntry($vid = NULL, $group_id = NULL) { if (!$vid) { $vid = $this->publication_version_id; } if (!$vid || !$group_id) { return false; } return parent::load(array('publication_version_id' => (int) $vid, 'group_id' => (int) $group_id)); }
/** * Get a record and bind to $this * * @param integer $userid User ID * @param integer $wishid Wish ID * @return boolean False if error, True on success */ public function load_vote($userid = NULL, $wishid = NULL) { $userid = $userid ?: $this->userid; $wishid = $wishid ?: $this->wishid; if ($userid === NULL or $wishid === NULL) { $this->setError(Lang::txt('Missing wish or user ID')); return false; } return parent::load(array('userid' => $userid, 'wishid' => $wishid)); }
/** * Load a record and bind to $this * * @param string $alias Entry alias * @param integer $id Entry ID * @return boolean True upon success, False if errors */ public function loadService($alias = NULL, $id = NULL) { if ($alias === NULL && $id === NULL) { return false; } if ($alias) { return parent::load(array('alias' => $alias)); } return parent::load($id); }
/** * get a package table object * * @return object connection tables */ public function &getPackage() { if (!isset($this->package)) { $this->package = FabTable::getInstance('Package', 'FabrikTable'); $this->package->load($this->id); // Forms can currently only be set from form module $this->package->forms = ''; } return $this->package; }
public function load($keys = null, $reset = true) { $return = parent::load($keys, $reset); if ($return !== false && (int) $this->id > 0 && empty($this->items)) { $db = JFactory::getDbo(); $db->setQuery('select * from #__djc2_quote_items where quote_id=' . (int) $this->id); $this->items = $db->loadObjectList('id'); } return $return; }
function load($id = 0, $reset = true) { $db = JFactory::getDBO(); $sql = "select id from #__guru_customer where id='" . $id . "'"; $db->setQuery($sql); $realid = $db->loadResult(); if (isset($_POST['cid'])) { $realid = $id; } parent::load($realid, true); }
public function load($key = null, $customLoad = false) { if ($customLoad == false) { parent::load($key); } $db = DiscussHelper::getDBO(); $query = 'SELECT * FROM ' . $db->nameQuote('#__discuss_customfields_rule') . ' WHERE ' . $db->nameQuote('field_id') . '=' . $db->Quote($key); $db->setQuery($query); $results = $db->loadObjectList(); return !$results ? false : $results; }
function load($id = 0, $reset = true) { $db = JFactory::getDBO(); $sql = "select aid from #__ad_agency_advertis where user_id='" . intval($id) . "'"; $db->setQuery($sql); $realid = $db->loadResult(); if (isset($_POST['cid'])) { $realid = $id; } parent::load($realid, true); }
/** * Load a record and bind to $this * * @param mixed $oid Integer or string (alias) * @return void */ public function load($keys = NULL, $reset = true) { if (is_numeric($keys)) { return parent::load($keys); } return parent::load(array('name' => trim($keys))); }