Gets data by id

@param mixed $id Identifier of data
@param bool $cascade If true it will join result data with related data
@return array[]
512764
public function getById($id, $cascade = false) {
        $result = self::getField($this->data, $id, null);
        if ($cascade && null !== $result && isset($this->one[$id])) {
            foreach ($this->one[$id] as $class => $foreignId) {
                $result = array_merge($class::getInstance()->getById($foreignId, $cascade), $result);
            }
        }
        return $result;
    }
1001535
public static function getRelatedPeople($id)
    {
        global $config;
        $req="SELECT idEvenement
            FROM `_evenementPersonne`
            WHERE `idPersonne` = '".mysql_real_escape_string($id)."';";
        $res = $config->connexionBdd->requete($req);
        $return = array();
        while ($event=mysql_fetch_object($res)) {
            $req2="SELECT DISTINCT idPersonne
                FROM `_evenementPersonne`
                WHERE `idEvenement` =".$event->idEvenement;
            $res2 = $config->connexionBdd->requete($req2);
            while ($person=mysql_fetch_object($res2)) {
                if ($person->idPersonne != $id && !in_array($person->idPersonne, $return)) {
                    $return[]=$person->idPersonne;
                }
            }
        }
        return $return;
    }
763574
public function findMany($id, $columns = array('*'))
	{
		$this->query->whereIn($this->model->getKeyName(), $id);

		return $this->get($columns);
    }
539276
public function get(string $id, bool $with_config = true): ?array
  {
    if ( bbn\str::is_uid($id) ){
      $cols = implode(', ', array_map(function($a){
        return $a;
      }, $this->fields));
      $table = $this->db->tsn($this->class_cfg['table'], true);
      $uid = $this->db->csn($this->fields['id'], true);
      $id_user = $this->db->csn($this->fields['id_user'], true);
      $id_group = $this->db->csn($this->fields['id_group'], true);
      $public = $this->db->csn($this->fields['public'], true);
      $sql = <<< MYSQL
SELECT $cols
FROM $table
WHERE $uid = UNHEX(?)
AND ($id_user = UNHEX(?)
OR $id_group = UNHEX(?)
OR $public = 1)
MYSQL;
      if ( $row = $this->db->get_row($sql, $id, $this->id_user, $this->id_group) ){
        $cfg = $row['cfg'];
        unset($row['cfg']);
        if ( ($cfg = json_decode($cfg, true)) && $with_config ){
          $row = bbn\x::merge_arrays($cfg, $row);
        }
        return $row;
      }
    }
    return null;
  }
24740
public function getChilds($id)
    {
        $result = [];
        if (array_key_exists($id, $this->finder)) {
            return $this->recursiveGetChilds($this->finder[$id][$this->config['childs']], $result);
        } else {
            return $result;
        }
    }
1287554
public function find($id, array $columns = ['*'])
    {
        if (is_array($id)) {
            return $this->findMany($id, $columns);
        }

        return $this->getBy($this->getModel()->getQualifiedKeyName(), $id, $columns);
    }
626021
public function fetchById($id)
    {
        $data = parent::fetchById($id);
        if ($data) {
            foreach (array_keys($this->subAttributeList) as $subKey) {
                $data[$subKey] = $this->fetchSubAttributeById($id, $subKey);
            }
        }
        return $data;
    }
169236
public function getMany(array $id) {
		$preparedIds = array_map([$this, 'prepareId'], $id);
		
		$result = $this->getBackend()->getMany($preparedIds);
		
		if (empty($result)) {
			return $result;
		}
		
		if ($this->_namespace !== null) {
			$ids = array_intersect_key(array_combine($preparedIds, $id), $result);
			return array_combine(array_values($ids), array_values($result));
		}
		
		return $result;
	}
601773
public function fetchById($id)
    {
        if ($this->hasCache()) {
            $data = $this->getCacheItem($id);
            return $data;
        }
        return parent::fetchById($id);
    }
1278420
public function getTags($id = false, array $array = [], $section, $modelClass = __CLASS__)
    {
        $tags = [$section, $modelClass];

        if ($id) {
            $tags[] = $modelClass . 'id' . $id;
        }

        if ($array) {
            foreach ($array as $relation) {
                $tags[] = $relation;
            }
        }

        return $tags;
    }
382492
public function get_item($id)
	{
		// Element empty!
		if (count($this->_items) === 0)
			return FALSE;

		if (array_key_exists($id, $this->_items))
		{ // By ID
			return $this->_items[$id];
		} else
		{ // By route
			$path = $this->get_tree_index(Route::get($id));

			if($path != false)
			{
				$levels = count($path);

				$item = $this->_items[$path[0]];

				if($levels > 1)
				{
					for($i=1; $i<$levels; $i++)
					{
						$item = $item->siblings[$path[$i]];
					}
				}
				return $item;
			}
		}
		return FALSE;
	}
1113806
public function getById($id)
    {
        return isset($this->_data[$id]) ? $this->_data[$id] : null;
    }
503366
public function fetchById($id) {
		return $this->getConnection()->where($this->getDao()->getTableId(), $id)->get($this->getDao()->getTableName());
	}
1013000
public function read(string $id) :? array
    {
        static $stmt;
        if (!isset($stmt)) {
            $stmt = $this->pdo->prepare("SELECT * FROM cesession_session WHERE id = :id");
        }
        $stmt->execute(compact('id'));
        if ($data = $stmt->fetch(\PDO::FETCH_ASSOC)) {
            $this->exists = true;
            $data['data'] = base64_decode($data['data']);
            return $data;
        }
        $this->exists = false;
        return null;
    }
505628
public function read( $id )
	{
		$this->inital_session_id = $id;
		
		if ( $data = \DB::select( $this->table )->where( 'id', $id )->one( $this->database ) )
		{
			$session_data = unserialize( $data->content );
			
			foreach( $this->index_fields as $field ) 
			{
				$session_data[$field] = $data->$field;
			}
			
			return $session_data;
		}
		
		return array();
	}
390913
public static function getParent($list, $id)
    {
        if (!is_array($list)) return [];
        $temp = [];
        foreach ($list as $v) {
            $temp[$v[self::$config['id']]] = $v;
        }
        $parentid = $temp[$id][self::$config['pid']];
        return $temp[$parentid];
    }
1015361
public function get($id)
    {
        if (isset($this->objects[$id])) {
            return $this->objects[$id];
        } else {
            return false;
        }
    }