当前位置: 首页>>代码示例>>PHP>>正文


PHP JTable::load方法代码示例

本文整理汇总了PHP中JTable::load方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::load方法的具体用法?PHP JTable::load怎么用?PHP JTable::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JTable的用法示例。


在下文中一共展示了JTable::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: unserialize

 /**
  * 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;
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:37,代码来源:connection.php

示例2: loadByVersion

 /**
  * 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));
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:13,代码来源:audience.php

示例3: load

 /**
  * 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;
 }
开发者ID:pashakiz,项目名称:crowdf,代码行数:41,代码来源:project.php

示例4: load

 function load($id = null)
 {
     parent::load($id);
     jimport('joomla.html.parameter');
     $params = new JParameter($this->settings);
     $this->settings = $params->toArray();
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:bidusersettings.php

示例5: load

 /**
  * 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);
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:15,代码来源:resource.php

示例6: load

 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;
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:32,代码来源:category.php

示例7: getRow

 /**
  * 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;
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:13,代码来源:plugin.php

示例8: testPublish

 /**
  * 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);
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:15,代码来源:JTableTest.php

示例9: load

 /**
  * 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);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:11,代码来源:postassignment.php

示例10: load

 public function load($oid = null)
 {
     $ret = parent::load($oid);
     if ($ret === true) {
         $this->_exists = true;
     }
     return $ret;
 }
开发者ID:adoucette,项目名称:com_kunenaimporter,代码行数:8,代码来源:kunena.php

示例11: load

 public function load($keys = null, $reset = true)
 {
     if (K2_JVERSION == '15') {
         return parent::load($keys);
     } else {
         return parent::load($keys, $reset);
     }
 }
开发者ID:Gskflute,项目名称:joomla25,代码行数:8,代码来源:table.php

示例12: loadByIp

 /**
  * 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));
 }
开发者ID:sumudinie,项目名称:hubzero-cms,代码行数:15,代码来源:log.php

示例13: load

 /**
  * 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;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:14,代码来源:message.php

示例14: load

 /**
  * 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;
 }
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:24,代码来源:item.php

示例15: load

 function load($oid = null)
 {
     $ret = parent::load($oid);
     if ($ret === true) {
         $this->_exists = true;
     }
     $this->userid = (int) $oid;
     return $ret;
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:9,代码来源:kunena.session.class.php


注:本文中的JTable::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。