If the primary key is not null, return the hashcode of the
primary key. Otherwise, return the hash code of the object.

@return int Hashcode
160913
public function hashCode()
    {
        $validPk = null !== $this->getCategoryId() &&
            null !== $this->getPageId();

        $validPrimaryKeyFKs = 2;
        $primaryKeyFKs = [];

        //relation c2p_fk_904832 to table category
        if ($this->aCategory && $hash = spl_object_hash($this->aCategory)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        //relation c2p_fk_c9a38a to table page
        if ($this->aPage && $hash = spl_object_hash($this->aPage)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        if ($validPk) {
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
        } elseif ($validPrimaryKeyFKs) {
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
        }

        return spl_object_hash($this);
    }
306873
public function key()
    {
        return isset($this->mappedEnums[$this->iteratorIndex])
            ? $this->mappedEnums[$this->iteratorIndex]
            : null;
    }
805660
public function key() {
		if ($this->_key !== null) {
			return $this->_key;
		}
		$this->_key = sha1(microtime());
		if (!$this->_key) {
			throw new RuntimeException('Invalid key generated');
		}

		return $this->_key;
	}
822570
public function getHashCode()
	{
		if ($this->_isSupervisor) {
			return $this->getSharedComponent()->getHashCode();
		}
		return md5(
			  $this->_formatCode
			. $this->_builtInFormatCode
			. __CLASS__
		);
	}
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;
    }
897773
private function getHash()
	{
		if($this->_hash===null)
			$this->_hash=sha1(serialize($this));
		return $this->_hash;
	}
117962
protected function getHash()
    {
        $query  = $this->getSQL();
        $hints  = $this->getHints();
        $params = array_map(function(Parameter $parameter) {
            // Small optimization
            // Does not invoke processParameterValue for scalar values
            if (is_scalar($value = $parameter->getValue())) {
                return $value;
            }

            return $this->processParameterValue($value);
        }, $this->parameters->getValues());

        ksort($hints);

        return sha1($query . '-' . serialize($params) . '-' . serialize($hints));
    }
746075
public function getPrimaryKey()
    {
        $columns = $this->getColumns();

        if (!isset($columns)) {
            throw new DatabaseException('Column schema not found!');
        }

        if (count($columns) > 0) {
            $primaryKey = null;
            foreach ($columns as $key => $value) {
                if ($value['COLUMN_KEY'] == 'PRI' || $value['EXTRA'] == 'auto_increment') {
                    $primaryKey = $value['COLUMN_NAME'];
                    break;
                }
            }
        }

        return $primaryKey;
    }
1372105
public function getKeyName()
	{
		if (isset($this->primaryKey)) return $this->primaryKey;
		
		return 'id_' . str_replace('\\', '', snake_case(class_basename($this)));
	}
803481
public function getHashCode() {
    	return md5(
    		  $this->_conditionType
    		. $this->_operatorType
    		. implode(';', $this->_condition)
    		. $this->_style->getHashCode()
    		. __CLASS__
    	);
    }
1148283
public function key()
    {
        $file = $this->current();
        return ($file !== null) ? (string) $file->file['_id'] : null;
    }
127173
public function key()
    {
        $key = key($this->container);
        if ($this->key_type === GPBType::BOOL) {
            // PHP associative array stores bool as integer for key.
            return boolval($key);
        } elseif ($this->key_type === GPBType::STRING) {
            // PHP associative array stores int string as int for key.
            return strval($key);
        } else {
            return $key;
        }
    }
1213932
public function hashCode()
    {
        $validPk = null !== $this->getRoleId() &&
            null !== $this->getPermissionId();

        $validPrimaryKeyFKs = 2;
        $primaryKeyFKs = [];

        //relation role_permission_fk_1ff99e to table role
        if ($this->aRole && $hash = spl_object_hash($this->aRole)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        //relation role_permission_fk_2b894c to table permission
        if ($this->aPermission && $hash = spl_object_hash($this->aPermission)) {
            $primaryKeyFKs[] = $hash;
        } else {
            $validPrimaryKeyFKs = false;
        }

        if ($validPk) {
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
        } elseif ($validPrimaryKeyFKs) {
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
        }

        return spl_object_hash($this);
    }
1166508
public static function getPrimaryKey()
    {
        $attribute = 'primary-key';

        // retrieve value from class setting definition
        if (!static::hasClassAttribute($attribute)) {
            $key = null;
            $schema = static::getSchema();

            foreach ($schema as $field => $aspects) {
                if ($aspects['Key'] == 'PRI') {
                    $key = $field;
                    break;
                }
            }

            static::setClassAttribute($attribute, $key);
        }

        return static::getClassAttribute($attribute);
    }
886465
public function getHashCode()
    {
        if ($this->isSupervisor) {
            return $this->getSharedComponent()->getHashCode();
        }
        return md5(
            $this->argb .
            __CLASS__
        );
    }
439294
public static function getKeyIndex(): int
    {
        if (self::$keyIndex == PHP_INT_MAX) {
            self::$keyIndex = 0;
        } else {
            self::$keyIndex++;
        }

        return self::$keyIndex;
    }
64437
public function key()
    {
        if ($this->assocArray) {
            $keys = array_keys($this->val);
            return $keys[$this->position];
        }

        return $this->position;
    }