Casts the identifier to its database type.

@param mixed $id

@return mixed $id
420793
public function getDatabaseIdentifierValue($id)
    {
        $idType = $this->fieldMappings[$this->identifier]['type'];
        return Type::getType($idType)->convertToDatabaseValue($id);
    }
662687
public function offsetGet($id)
    {
        if (!isset($this->registered[$id])){
            return null;
        }
        if (isset($this->instances[$id])){
            return $this->instances[$id];
        }
        // create new object via factory
        $factory = $this->factories[$id];
        if (!$factory || !is_callable($factory) || !method_exists($factory, '__invoke')){
            return null;
        }
        // get current slot
        $slot = $this->slots[$id] ?? new Slot($id);
        // callback factory to get new instance
        $newInstance = $this->callbackFactory($id, $slot, $factory);
        // replace instance
        $this->replaceInstance($id, $slot, $newInstance);
        return $newInstance;
    }
35439
protected function getConcrete($id)
    {
        if (!isset($this->binds[$id])) {

            return $id;          

        } else {

            return $this->binds[$id]['concrete'];

        }
    }
719646
public function getPHPIdentifierValue($id)
    {
        $idType = $this->fieldMappings[$this->identifier]['type'];
        return Type::getType($idType)->convertToPHPValue($id);
    }
764443
protected function loadInternal($id)
    {
        if ($this->table !== null && $this->id_field !== null) {
            $id_field = new SwatDBField($this->id_field, 'integer');
            $sql = 'select * from %s where %s = %s';

            $sql = sprintf(
                $sql,
                $this->table,
                $id_field->name,
                $this->db->quote($id, $id_field->type)
            );

            $rs = SwatDB::query($this->db, $sql, null);
            $row = $rs->fetchRow(MDB2_FETCHMODE_ASSOC);

            return $row;
        }
        return null;
    }
348162
public static function findIdentity($id) : ?Identity
    {
        $user = self::getRepository()->findActiveById($id);
        return $user ? new self($user) : null;
    }
171579
public function setId($id)
    {
        if (!empty($id) && is_string($id) && ctype_print($id)) {
            $this->id = trim($id);
        }

        return $this;
    }
1131656
public function getById(int $id)
    {
        $result = $this->builder->getById($id);

        if (isset($result[0])) {
            return self::instance($result[0]);
        }

        return null;
    }
508790
public function setDatatableId($id)
    {
        if (!array_key_exists($id, self::$instances)) {
            self::$instances[$id] = $this;
        } else {
            throw new \Exception('Identifer already exists');
        }

        return $this;
    }
1066609
public static function getInstance($id = '0')
    {
        self::$id = $id;
        if (isset(self::$instances[self::$id])) {
            return self::$instances[self::$id];
        }

        return self::$instances[self::$id] = new self;
    }
991202
public static function classIdentifierByID( $id )
    {
        $identifierHash = array_flip( self::classIdentifiersHash() );

        if ( isset( $identifierHash[$id] ) )
            return $identifierHash[$id];
        else
            return false;
    }
448300
public function setID($id)
    {
        $dao = $this->getDAO();
        $pkey = $dao->getPrimaryKey();

        if (count($pkey) === 1 && is_scalar($id))
        {
            $pcol = reset($pkey);
            $this->setField($pcol->getName(), $id);
        }
        elseif (is_array($id) && array_keys($id) === array_keys($pkey))
        {
            foreach ($pkey as $name => $def)
            {
                $this->setField($name, $id[$name]);
            }
            $this->_id = $id;
        }
        else
        {
            throw new InvalidTypeException("Provided ID does not match primary key");
        }
        return $this;
    }
30810
protected function _id($id)
    {
        if (($id !== null) && isset($this->_options['cache_id_prefix'])) {
            return $this->_options['cache_id_prefix'] . $id; // return with prefix
        }
        return $id; // no prefix, just return the $id passed
    }
321378
public function getType($id)
    {
        if (null === $id) {
            // The caller might call us using a row from database that contains
            // a strict null, it is useless for us to do any query since null
            // typed messages are valid by the MessageInterface signature
            return null;
        }

        if (null === $this->types) {
            $this->loadCache();
        }

        if (!isset($this->types[$id])) {
            // Someone may have created it before we loaded the cache
            $this->loadCache();

            if (!isset($this->types[$id])) {
                // It seems that the type really does not exists, mark it as
                // being wrong in order to avoid to refresh the cache too often
                // and return a null type
                $this->types[$id] = false;
            }
        }

        if (false === $this->types[$id]) {
            return null;
        } else {
            return $this->types[$id];
        }
    }
288530
public function filterById($id)
	{
		$alias = $this->getAlias();
		$key = $this->getPrimaryKey();
		return $this->filterBy(array("{$alias}.{$key}"=>$id));
	}
927674
public function findSecurityTypeById($id)
    {
        try {
            $qb = $this->createQueryBuilder('securityType')
                ->where('securityType.id=:securityTypeId');

            $query = $qb->getQuery();
            $query->setParameter('securityTypeId', $id);

            return $query->getSingleResult();
        } catch (NoResultException $ex) {
            return;
        }
    }
915027
public static function getById($id)
    {
        $result = null;
        $info = CldrData::getLanguageInfo($id);
        if (isset($info)) {
            $result = new Language($info);
        }

        return $result;
    }