Returns unique ID of inherited object or in case of compound key, an indexed array.

@return int|string|array
510936
final public function getId() {
		
		$ids = array();
			
		foreach ($this->keyProperties as $propertyName) {
			$ids[] = $this->{$propertyName};
		}
		
		return (static::hasCompoundKey() ? $ids : $ids[0]);
		
	}
1342800
public function getId()
    {
        $value = $this->getFirstValue(PropertyIds::OBJECT_ID);
        if (is_string($value)) {
            return $value;
        }
        return null;
    }
816122
public function id() {
		$res = $this->_match;
		$count = count($res);

		if (empty($this->_stub['id'])) {
			if (empty($res[$count - 1])) {
				return '';
			}
			$this->_stub['id'] = $res[$count - 1];
		}
		$id = $this->_stub['id'];

		for ($i = 1; $i <= $count; $i++) {
			$id = str_ireplace('$' . $i, $res[$i - 1], $id);
		}
		return $id;
	}
92971
public function get_unique_id() {
        global $CFG;

        if (!is_null($this->uniqueid)) {
            return $this->uniqueid;
        }

        // Generate a unique id for this site, this model and this time splitting method, considering the last time
        // that the model target and indicators were updated.
        $ids = array($CFG->wwwroot, $CFG->prefix, $this->model->id, $this->model->version);
        $this->uniqueid = sha1(implode('$$', $ids));

        return $this->uniqueid;
    }
281880
function it_should_be_unique(){
        $ids = [];
        $iterations = 100;

        for($i=0; $i < $iterations; $i++){
            $ids[] = $this->getWrappedObject()->generate();
        }

        return (count(array_values($ids)) === $iterations);
    }
290949
public function id($as_array = false)
    {
        $keys = static::getMapper()->getPrimaryKey();
        $id = [];

        foreach ($keys as $key) {
            $id[$key] = $this->get($key);
        }

        if ($as_array || count($id) > 1) {
            return $id;
        }

        return current($id);
    }
1372105
public function getKeyName()
	{
		if (isset($this->primaryKey)) return $this->primaryKey;
		
		return 'id_' . str_replace('\\', '', snake_case(class_basename($this)));
	}
914771
public function getID() {
		$parents = $this->getParents();
		$c = count($parents);

		if($c > 0) {
			$id = $parents[0].'-';
			for($i=1; $i<$c; $i++)
				$id .= $parents[$i].'-';
			$id .= $this->name;
			return $id;
		}
		else
			return $this->name;
	}
300701
protected function GetUniqueItemKey()
    {
        $iCurrentPointer = $this->getItemPointer();
        $this->GoToStart();
        $aItemKeyList = array();
        while ($oItem = $this->Next()) {
            $aItemKeyList[] = $oItem->sBasketVoucherKey;
        }
        // now generate a key

        do {
            $sKey = md5(uniqid(rand(), true));
        } while (in_array($sKey, $aItemKeyList));

        return $sKey;
    }
1342315
public function getId() : ?string 
    {
        if ( ! $this->hasId()) {
            $this->setId($this->getDefaultId());
        }
        return $this->id;
    }
600203
protected function _getPrimaryKey()
    {
        if (!$this->_primaryKey) {
            $primaryKey = (array)$this->_table->getPrimaryKey();
            $this->_primaryKey = $primaryKey[0];
        }

        return $this->_primaryKey;
    }
922628
protected function getKeyFromInput() {
        $Model = $this->Model;

        $key = $this->model->getKeyName();
        $id = Input::get($key);

        return $id;
    }
727985
public static function getNumericId()
    {
        $hashId = self::getId();
        $id = (integer) substr(preg_replace('/[a-z]+/', '', $hashId), 0, 9);
        $letters = preg_replace('/[0-9]+/', '', $hashId);
        for ($i = 0, $length = strlen($letters); $i < $length; $i++) {
            $id += ord($letters[$i]) - 97;
        }
        return $id;
    }
1366274
public function getPrevious()
    {
        if (false === $this->pointer || !$this->count || 0 == $this->pointer) {
            return null;
        }
        return $this->ids[$this->pointer - 1];
    }
563850
public function getDefinition()
    {
        $columnNames = " (`" . implode("`,`", $this->columnNames) . "`)";
        switch ($this->indexType) {
            case self::PRIMARY:
                return "PRIMARY KEY" . $columnNames;
                break;
            case self::INDEX:
                return "KEY `" . $this->indexName . "`" . $columnNames;
                break;
            case self::UNIQUE:
                return "UNIQUE `" . $this->indexName . "`" . $columnNames;
                break;
            case self::FULLTEXT:
                return "FULLTEXT KEY `" . $this->indexName . "`" . $columnNames;
                break;
        }

        return "";
    }
985263
public function getRelatedForeignKey()
    {
        if (null == $this->relatedForeignKey) {
            $name = $this->getParentTableName();
            $this->relatedForeignKey = "{$this->normalizeFieldName($name)}_id";
        }
        return $this->relatedForeignKey;
    }
1286808
public function unique()
    {
        $count = count($this->sfa);
        $unique = new SplFixedArray($count);
        $newCount = 0;
        $lastUnique = null;

        foreach ($this->sfa as $el) {
            for($i = $newCount; $i >= 0; $i--) {
                // going from back to forward to find sequence of duplicates faster
                if ($unique[$i] === $el) {
                    continue 2;
                }
            }
            $unique[$newCount++] = $el;
        }

        $unique->setSize($newCount);
        return new static($unique);
    }