示例#1
0
 public function load($keys = null, $reset = true)
 {
     $state = parent::load($keys, $reset);
     if (!$state) {
         return false;
     }
     $this->extractParams();
     return true;
 }
示例#2
0
 /**
  * Override parent's load implementation
  *
  * @since   1.0
  * @access  public
  * @param   int     The unique row id.
  * @param   bool    True to reset the default values before loading the new row.
  *
  * @author  Mark Lee <*****@*****.**>
  */
 public function load($key = null, $reset = true)
 {
     $state = parent::load($key, $reset);
     // @rule: We want to see which steps the user has already walked through.
     if (empty($this->step_access)) {
         $this->step_access = array();
     }
     if (!empty($this->step_access) && is_string($this->step_access)) {
         $this->step_access = explode(',', $this->step_access);
     }
     return $state;
 }
示例#3
0
 /**
  * Overrides parent's load implementation
  *
  * @since	1.0
  * @access	public
  */
 public function load($keys = null, $reset = true)
 {
     if (is_array($keys)) {
         return parent::load($keys, $reset);
     }
     if (!isset(self::$_streams[$keys])) {
         $state = parent::load($keys);
         self::$_streams[$keys] = $this;
         return $state;
     }
     return parent::bind(self::$_streams[$keys]);
 }
示例#4
0
 public function load($id = null, $reset = true)
 {
     if (is_array($id)) {
         return parent::load($id, $reset);
     }
     if (!isset(self::$_shares[$id])) {
         parent::load($id);
         self::$_shares[$id] = $this;
     } else {
         $this->bind(self::$_shares[$id]);
     }
     return true;
 }
示例#5
0
 public function load($uid = null, $userId = null, $type = SOCIAL_STREAM_HIDE_TYPE_STREAM)
 {
     if (empty($uid) || empty($userId)) {
         return false;
     }
     $db = FD::db();
     $query = 'select `id` from `#__social_stream_hide`';
     $query .= ' where `user_id` = ' . $db->Quote($userId);
     $query .= ' and `uid` = ' . $db->Quote($uid);
     $query .= ' and `type` = ' . $db->Quote($type);
     $db->setQuery($query);
     $id = $db->loadResult();
     return parent::load($id);
 }
示例#6
0
 /**
  * Override parent's load implementation
  *
  * @since	1.0
  * @access	public
  * @param	int		The unique row id.
  * @param   bool	True to reset the default values before loading the new row.
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public function load($key = null, $reset = true)
 {
     $state = parent::load($key, $reset);
     // If state is false, then we create the session here
     if (!$state) {
         $session = JFactory::getSession();
         $this->session_id = $session->getId();
         $this->created = FD::date()->toSql();
         $state = $this->store();
     }
     // @rule: We want to see which steps the user has already walked through.
     if (empty($this->step_access)) {
         $this->step_access = array();
     }
     if (!empty($this->step_access) && is_string($this->step_access)) {
         $this->step_access = explode(',', $this->step_access);
     }
     return $state;
 }
示例#7
0
 public function load($uid = null, $utype = '', $component = 'com_easysocial')
 {
     if (empty($uid)) {
         return false;
     }
     if ($utype) {
         $db = FD::db();
         $query = 'select * from ' . $db->nameQuote('#__social_indexer');
         $query .= ' where ' . $db->nameQuote('uid') . ' = ' . $db->Quote($uid);
         $query .= ' and ' . $db->nameQuote('utype') . ' = ' . $db->Quote($utype);
         $query .= ' and ' . $db->nameQuote('component') . ' = ' . $db->Quote($component);
         $db->setQuery($query);
         $result = $db->loadObject();
         if (!$result) {
             return false;
         }
         parent::bind($result);
     } else {
         parent::load($uid);
     }
     return true;
 }
示例#8
0
 /**
  * Overrides parent's load implementation
  *
  * @since	1.0
  * @access	public
  */
 public function load($keys = null, $reset = true)
 {
     $loadFromUid = false;
     if (is_array($keys)) {
         if (count($keys) == 1 && isset($keys['uid'])) {
             $loadFromUid = true;
         } else {
             return parent::load($keys, $reset);
         }
     }
     $state = false;
     if ($loadFromUid) {
         $uid = $keys['uid'];
         if (!isset(self::$_streamitems[$uid])) {
             $state = parent::load(array('uid' => $uid));
             self::$_streamitems[$uid] = $this;
             return $state;
         }
         $state = parent::bind(self::$_streamitems[$uid]);
     } else {
         $state = parent::load($keys, $reset);
     }
     return $state;
 }
示例#9
0
 /**
  * Deprecated. Redirected to native load function instead.
  *
  * @author Jason Rey <*****@*****.**>
  * @since  1.0
  * @deprecated Deprecated since 1.2. Use native load function instead.
  * @access public
  * @param  Int		$fieldId	The field id
  * @param  Int		$uid		The target unique id
  * @param  String	$type		The target type
  * @return SocialTableFieldData	The table object
  */
 public function loadByField($fieldId, $uid, $type)
 {
     return parent::load(array('field_id' => $fieldId, 'uid' => $uid, 'type' => $type));
 }
示例#10
0
 /**
  * Overrides parent's load implementation
  *
  * @since   1.0
  * @access  public
  */
 public function load($keys = null, $reset = true)
 {
     if (self::$_cache) {
         if (is_array($keys)) {
             return parent::load($keys, $reset);
         }
         if (!isset(self::$_photos[$keys])) {
             $state = parent::load($keys);
             self::$_photos[$keys] = $this;
             return $state;
         }
         if (is_bool(self::$_photos[$keys])) {
             return false;
         }
         return parent::bind(self::$_photos[$keys]);
     } else {
         return parent::load($keys, $reset);
     }
 }
示例#11
0
 /**
  * Overrides parent's load implementation
  *
  * @since	1.0
  * @access	public
  */
 public function load($keys = null, $reset = true)
 {
     $state = false;
     $loaded = false;
     if (is_array($keys)) {
         $state = parent::load($keys, $reset);
     } else {
         if (!isset(self::$_albums[$keys])) {
             $state = parent::load($keys);
             self::$_albums[$keys] = $this;
         } else {
             $value = self::$_albums[$keys];
             if (is_bool($value)) {
                 $state = false;
             } else {
                 $state = parent::bind($value);
             }
             $loaded = true;
         }
     }
     if ($state && !$loaded) {
         // Converts params into an object first
         if (empty($this->params)) {
             $this->params = new stdClass();
         } else {
             $this->params = FD::json()->decode($this->params);
         }
     }
     return $state;
 }
示例#12
0
 /**
  * Depcreated in 1.3. Use native load function instead.
  * Retrieves a particular step based on the sequence and the workflow id.
  *
  * Example:
  * <code>
  * <?php
  * $table 	= FD::table( 'Workflow' );
  * $table->loadBySequence( JRequest::getInt( 'profileId' ) , JRequest::getInt( 'step' ) );
  * ?>
  * </code>
  *
  * @deprecated		Depcreated since 1.3. Use native load function instead.
  * @since	1.0
  * @param   int		The unique profile id.
  * @param   int     The sequence / step.
  * @return  bool	True on success, false otherwise.
  *
  * @author	Mark Lee <*****@*****.**>
  */
 public function loadBySequence($uid, $type = SOCIAL_TYPE_USER, $sequence)
 {
     return parent::load(array('uid' => $uid, 'type' => $type, 'sequence' => $sequence));
 }