Get the value of the model's primary key.

@return mixed
965612
public function getKey()
    {
        $attributes = [];

        foreach ($this->getKeyName() as $key) {
            $attributes[$key] = $this->getAttribute($key);
        }

        return $attributes;
    }
1116760
public function getKey()
    {
        $key = false;

        if (count($this->where) == 1) {
            $where = array_values($this->where);
            $where = array_pop($where);

            if (isset($where['property'])) {
                $property = $where['property'];
                $keys = $this->getRepository()->getDescription()->getIdentifyingProperties();
                if (isset($keys[$property]) && isset($where['constraint']) && $where['constraint'] == '=' && !is_array($where['value'])) {
                    $key[$property] = $where['value'];
                }
            }
        }

        return $key;
    }
474932
public function getMainForeignKeyColumnName() {
        /** @var KeyValueTableInterface $this */
        if (empty($this->_detectedMainForeignKeyColumnName)) {
            foreach ($this->getTableStructure()->getRelations() as $relationConfig) {
                if ($relationConfig->getType() === Relation::BELONGS_TO) {
                    $this->_detectedMainForeignKeyColumnName = $relationConfig->getLocalColumnName();
                    break;
                }
            }
            if ($this->_detectedMainForeignKeyColumnName === null) {
                throw new \BadMethodCallException(
                    get_called_class() . '::' . __METHOD__ . ' - cannot find foreign key column name'
                );
            }
        }
        return $this->_detectedMainForeignKeyColumnName;
    }
1204400
public function getId()
    {
        if (is_null($this->_id) && isset($this->object)) {
            $this->_id = $this->object->primaryKey;
        }

        return $this->_id;
    }
1224175
public function primaryKey()
    {
        $primaryKeys = [];
        foreach ($this->_columns as $name => $data) {
            if ((!array_key_exists('primaryKey', $data)) || ($data['primaryKey'] !== true)) {
                continue;
            }

            $primaryKeys[] = $name;
        }

        return $primaryKeys;
    }
161873
public function key()
    {
        if (empty($this->key) && !empty($this->definition->primary)) {
            $keys = array_values(
                array_filter(
                    preg_split('~[\s,]+~', $this->definition->primary)
                )
            );
            $keys = array_map(
                function ($key) {
                    return Normalise::toVariable($key);
                },
                $keys
            );

            $this->key = count($keys) > 1 ? $keys : array_shift($keys);
        }

        if (empty($this->key) && $this->has('id')) {
            $this->key = 'id';
        }

        return $this->key;
    }
1120321
public function pkValue()
    {
        if ($args = func_get_args()) {
            !is_array($args[0]) || $args = array_shift($args);
            $args = array_values($args);
            foreach ($args as $key=>$arg)
                $this->{$this->_properties['primary_key'][$key]} = $arg;

            return $this;
        }

        $pk = array_intersect_key($this->_schema['values'],
            array_fill_keys($this->_properties['primary_key'], null));

        return count($pk)==0?null:(count($pk)==1?array_shift($pk):$pk);
    }
1134501
public function getForeignKey()
    {
        if (is_null($this->foreignKey)) {
            $name = $this->getParentEntityDescriptor()->getTableName();
            $this->foreignKey = "{$this->normalizeFieldName($name)}_id";
        }
        return $this->foreignKey;
    }
733364
public function getPrimaryKeyColumns()
    {
        $primaryKey = $this->getPrimaryKey();

        if ($primaryKey === null) {
            throw new DBALException('Table ' . $this->getName() . ' has no primary key.');
        }

        return $primaryKey->getColumns();
    }
729302
public function getPrimaryKey() {
        if ($this->primaryKey === null) {
            $schema = $this->getSchema();

            $pk = [];
            foreach ($schema->getSchemaArray()['properties'] as $column => $property) {
                if (!empty($property['primary'])) {
                    $pk[] = $column;
                }
            }
            $this->primaryKey = $pk;
        }
        return $this->primaryKey;
    }
1167231
function GetPrimaryKeyName()
    {
        $fms = $this->_phreezer->GetFieldMaps(get_class($this));
        foreach ($fms as $fm)
        {
            if ($fm->IsPrimaryKey)
            {
				return $fm->PropertyName;
			}
        }

		/*
		print "<pre>";
		$this->Data = "";
		$this->_phreezer = null;
		$this->_cache = null;
		print_r($this);

		print_r($fms);
		die();
		*/

		throw new Exception("No Primary Key found for " . get_class($this));
    }
757862
private function _getData($primaryKey)
    {
        $table = $this->table;
        $db = $this->db;

        $query = "SELECT * FROM {$table->getTableName()} WHERE {$table->getPrimaryKey()} = $primaryKey";
        $sth = $table->getAdapter()->prepare($query);
        $sth->execute();

        return $sth->fetch($db::FETCH_ASSOC);
    }
4445
public function getForeignKey()
    {
        if ($this->_foreignKey === null) {
            $this->_foreignKey = $this->_modelKey($this->getSource()->getTable());
        }

        return $this->_foreignKey;
    }
845266
public function getPrimaryKey()
    {
        $pks = [];
        foreach ($this->__primaryKeys as $pk) {
            if (is_object($this->$pk)) {
                $traits = class_uses($this->$pk);
                if (isset($traits['Ornament\Model'])
                    || isset($traits['Ornament\JsonModel'])
                ) {
                    $pks[] = $this->$pk->getPrimaryKey();
                } else {
                    $pks[] = "{$this->$pk}";
                }
            } else {
                $pks[] = $this->$pk;
            }
        }
        return count($pks) == 1 ? $pks[0] : $pks;
    }
326679
final function KeyField()
    {
        if (!$this->keyField)
        {
            $fieldMappers = $this->FieldMappers();
            foreach ($fieldMappers as $name=>$mapper)
            {
                $keyInfo = $mapper->FieldInfo()->KeyInfo();
                if ($keyInfo && $keyInfo->IsPrimary())
                {
                    $this->keyField = $name;
                    break;
                }
            }
            if (!$this->keyField)
            {
                throw new \Exception('No (primary) key field found in ' . $this->TableName());
            }
        }
        return $this->keyField;
    }
119648
private function getKey()
    {
        if ($this->_key === null) {
            $this->_key = ftok(__FILE__, $this->id);
        }

        return $this->_key;
    }
780489
public function primaryKey()
    {
        if (empty($this->_context['schema']['_constraints']) ||
            !is_array($this->_context['schema']['_constraints'])
        ) {
            return [];
        }
        foreach ($this->_context['schema']['_constraints'] as $data) {
            if (isset($data['type']) && $data['type'] === 'primary') {
                return isset($data['columns']) ? (array)$data['columns'] : [];
            }
        }

        return [];
    }