Load specific entry from DB
@param int $id primary key
@return void
175284
public function load(int $id)
    {
        $sql = "SELECT * FROM `".$this->tableName."` "
            . "WHERE `".$this->primaryKey."` = '".$id."'"
            . "LIMIT 0,1;";
        $stmt = $this->db->query($sql);
        
        try {
            $row = $stmt->fetch(PDO::FETCH_ASSOC);
        } catch (Exception $ex) {
            $this->log->crit('Could not find requested entry in mySQL: '.$sql."\n".$ex->getMessage());
        }
        
        if (!is_array($row)) {
            return;
        }
        
        $this->loadWithData($row);
    }
655424
public function setId( $id )
	{
		if ( $id === null ) {
			$this->_modified = true;
		}

		$this->_values['id'] = $id;
	}
22218
def load(self, id=None):
        """"""
        if id is not None:
            # We are asked to change our ID to something else
            self.reset()
            self._setID(id)
        if not self._new and self._validID():
            self._loadDB()
        self._updated = time.time()
883319
protected function loadConfig(/*# string */ $id)
    {
        // get group name
        $group = $this->getGroupName($id);

        // $group loaded ?
        if (isset($this->loaded[$group])) {
            return $this;
        }

        // mark as loaded
        $this->loaded[$group] = true;

        // loading the group
        return $this->loadByGroup($group);
    }
1097560
public static function load($id, $options = [], $fetchOptions = [])
    {
        $options = ['conditions' => [static::definition()->key() => $id]] + $options;
        return static::find($options)->first($fetchOptions);
    }
1024040
public function load($id)
    {
        $rows = $this->sectionGateway->loadSectionData($id);

        if (empty($rows)) {
            throw new NotFound('Section', $id);
        }

        return $this->createSectionFromArray(reset($rows));
    }
65335
protected function loadModel($id)
    {
        if (empty($this->additionalCriteriaOnLoadModel)) {
            $model = CActiveRecord::model($this->modelName)->findByPk($id);
        } else {
            $finder = CActiveRecord::model($this->modelName);
            $c = new CDbCriteria($this->additionalCriteriaOnLoadModel);
            $c->mergeWith(
                array(
                    'condition' => $finder->tableSchema->primaryKey . '=:id',
                    'params' => array(':id' => $id),
                )
            );
            $model = $finder->find($c);
        }
        if (isset($model)) {
            return $model;
        }
        if ($this->additionalCriteriaOnLoadModel) {
            throw new CHttpException(404, 'Unable to find the requested object.');
        }
    }
1185557
public function loadByACLID($id)
    {
        $parts = explode("#", $id);
        if (count($parts) !== 2)
            throw new Exception("Invalid DAO ID: {$id}");
    
        if (!isset($this->classes[$parts[0]]))
            throw new Exception("Invalid DAO type: {$parts[0]}");
    
        $classname = $this->classes[$parts[0]];
        $pkey_values = explode("-", $parts[1]);

        $db = DB::getInstance();
        $dao = $db->getDAO($classname);
    
        return call_user_func(array($dao, "get"), $pkey_values);
    }
542800
public static function load($id, $subId = null) : CacheEntryInterface
    {
        $storageId = $id;

        if ($subId) {
            $storageId .= '[' . $subId . ']';
        }

        if (!isset(self::$files[$storageId])) {
            $filename = static::CACHE_DIR . ($subId ? $subId . '/' : null) . urlencode($id) . '.' . static::CACHE_EXTENSION;
            self::$files[$storageId] = new File($filename);
        }

        return self::$files[$storageId];
    }
234057
public function loadByMageOrderId($id)
    {
        $order = $this->_getResource()->getByOrderId($id);
        if (!empty($order)) {
            $this->setData($order);
        }

        return $this;
    }
652146
public function update($id = null) {
        if($id)
            $array = KernelDB::update($this, $this->tuples, static::$model, $id);
        else
            $array = KernelDB::update($this, $this->tuples, static::$model, kernelHttp::request()->getRequiredParameter());

        self::updateThis($this, $array);
    }
1229752
public function loadBean($id)
    {
        if ($this->currentBean != null) {
            throw new BeanNotNullException();
        }

        $this->currentBean = R::load($this->tableName, $id);
    }
834613
public function loadById($model, $id)
    {
        $data = $this->sendItemRequest($model, $id);
        if (is_array($data)) {
            $model->id = $id;
            $model->data = $data;
        }
    }
895208
protected function _load($id)
	{
		$db = JFactory::getDbo();
		$app = JFactory::getApplication();
		$user = JFactory::getUser();
		$extension = $this->_extension;

		// Record that has this $id has been checked
		$this->_checkedCategories[$id] = true;

		$query = $db->getQuery(true);

		// Right join with c for category
		$query->select('c.id, c.asset_id, c.access, c.alias, c.checked_out, c.checked_out_time,
			c.created_time, c.created_user_id, c.description, c.extension, c.hits, c.language, c.level,
			c.lft, c.metadata, c.metadesc, c.metakey, c.modified_time, c.note, c.params, c.parent_id,
			c.path, c.published, c.rgt, c.title, c.modified_user_id, c.version');
		$case_when = ' CASE WHEN ';
		$case_when .= $query->charLength('c.alias', '!=', '0');
		$case_when .= ' THEN ';
		$c_id = $query->castAsChar('c.id');
		$case_when .= $query->concatenate(array($c_id, 'c.alias'), ':');
		$case_when .= ' ELSE ';
		$case_when .= $c_id . ' END as slug';
		$query->select($case_when)
			->from('#__categories as c')
			->where('(c.extension=' . $db->quote($extension) . ' OR c.extension=' . $db->quote('system') . ')');

		if ($this->_options['access'])
		{
			$query->where('c.access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')');
		}

		if ($this->_options['published'] == 1)
		{
			$query->where('c.published = 1');

			$subQuery = ' (SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ' .
				'ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = ' . $db->quote($extension) .
				' AND parent.published != 1 GROUP BY cat.id) ';
			$query->join('LEFT', $subQuery . 'AS badcats ON badcats.id = c.id')
				->where('badcats.id is null');
		}

		$query->order('c.lft');

		// Note: s for selected id
		if ($id != 'root')
		{
			// Get the selected category
			$query->where('s.id=' . (int) $id);

			if ($app->isSite() && JLanguageMultilang::isEnabled())
			{
				$query->join('LEFT', '#__categories AS s ON (s.lft < c.lft AND s.rgt > c.rgt AND c.language in (' . $db->quote(JFactory::getLanguage()->getTag())
					. ',' . $db->quote('*') . ')) OR (s.lft >= c.lft AND s.rgt <= c.rgt)');
			}
			else
			{
				$query->join('LEFT', '#__categories AS s ON (s.lft <= c.lft AND s.rgt >= c.rgt) OR (s.lft > c.lft AND s.rgt < c.rgt)');
			}
		}
		else
		{
			if ($app->isSite() && JLanguageMultilang::isEnabled())
			{
				$query->where('c.language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
			}
		}

		// Note: i for item
		if ($this->_options['countItems'] == 1)
		{
			$queryjoin = $db->quoteName($this->_table) . ' AS i ON i.' . $db->quoteName($this->_field) . ' = c.id';

			if ($this->_options['published'] == 1)
			{
				$queryjoin .= ' AND i.' . $this->_statefield . ' = 1';
			}

			if ($this->_options['currentlang'] !== 0)
			{
				$queryjoin .= ' AND (i.language = ' . $db->quote('*') . ' OR i.language = ' . $db->quote($this->_options['currentlang']) . ')';
			}

			$query->join('LEFT', $queryjoin);
			$query->select('COUNT(i.' . $db->quoteName($this->_key) . ') AS numitems');
		}

		// Group by
		$query->group(
			'c.id, c.asset_id, c.access, c.alias, c.checked_out, c.checked_out_time,
			 c.created_time, c.created_user_id, c.description, c.extension, c.hits, c.language, c.level,
			 c.lft, c.metadata, c.metadesc, c.metakey, c.modified_time, c.note, c.params, c.parent_id,
			 c.path, c.published, c.rgt, c.title, c.modified_user_id, c.version'
		);

		// Get the results
		$db->setQuery($query);
		$results = $db->loadObjectList('id');
		$childrenLoaded = false;

		if (count($results))
		{
			// Foreach categories
			foreach ($results as $result)
			{
				// Deal with root category
				if ($result->id == 1)
				{
					$result->id = 'root';
				}

				// Deal with parent_id
				if ($result->parent_id == 1)
				{
					$result->parent_id = 'root';
				}

				// Create the node
				if (!isset($this->_nodes[$result->id]))
				{
					// Create the JCategoryNode and add to _nodes
					$this->_nodes[$result->id] = new JCategoryNode($result, $this);

					// If this is not root and if the current node's parent is in the list or the current node parent is 0
					if ($result->id != 'root' && (isset($this->_nodes[$result->parent_id]) || $result->parent_id == 1))
					{
						// Compute relationship between node and its parent - set the parent in the _nodes field
						$this->_nodes[$result->id]->setParent($this->_nodes[$result->parent_id]);
					}

					// If the node's parent id is not in the _nodes list and the node is not root (doesn't have parent_id == 0),
					// then remove the node from the list
					if (!(isset($this->_nodes[$result->parent_id]) || $result->parent_id == 0))
					{
						unset($this->_nodes[$result->id]);
						continue;
					}

					if ($result->id == $id || $childrenLoaded)
					{
						$this->_nodes[$result->id]->setAllLoaded();
						$childrenLoaded = true;
					}
				}
				elseif ($result->id == $id || $childrenLoaded)
				{
					// Create the JCategoryNode
					$this->_nodes[$result->id] = new JCategoryNode($result, $this);

					if ($result->id != 'root' && (isset($this->_nodes[$result->parent_id]) || $result->parent_id))
					{
						// Compute relationship between node and its parent
						$this->_nodes[$result->id]->setParent($this->_nodes[$result->parent_id]);
					}

					// If the node's parent id is not in the _nodes list and the node is not root (doesn't have parent_id == 0),
					// then remove the node from the list
					if (!(isset($this->_nodes[$result->parent_id]) || $result->parent_id == 0))
					{
						unset($this->_nodes[$result->id]);
						continue;
					}

					if ($result->id == $id || $childrenLoaded)
					{
						$this->_nodes[$result->id]->setAllLoaded();
						$childrenLoaded = true;
					}
				}
			}
		}
		else
		{
			$this->_nodes[$id] = null;
		}
	}
195643
protected function instantiate($id)
    {
        $this->instances[$id] = call_user_func($this->callbacks[$id], $this);
    }
742363
public function deleteRow(int $id) : void
    {
        $this->crudEnabled();

        // Generate the values
        $table_name = static::$table_name;
        $id_column = static::$id_column;

        $sql = "DELETE FROM {$table_name} WHERE {$id_column} = :key";
        $this->dbc->query($sql, ['params' => [':key' => $id]]);
    }
683280
public function load($id)
    {
        $row = $this->gateway->loadUrlWildcardData($id);

        if (empty($row)) {
            throw new NotFoundException('UrlWildcard', $id);
        }

        return $this->mapper->extractUrlWildcardFromRow($row);
    }