src/Leevel/Database/Ddd/Entity.php
public static function singlePrimaryKey(): string
    {
        $key = static::primaryKey();

        if (!is_string($key)) {
            $e = sprintf('Entity %s do not have primary key or composite id not supported.', static::class);

            throw new InvalidArgumentException($e);
        }

        return $key;
    }
public static function singlePrimaryKey(): string
    {
        $key = static::primaryKey();

        if (!is_string($key)) {
            $e = sprintf('Entity %s do not have primary key or composite id not supported.', static::class);

            throw new InvalidArgumentException($e);
        }

        return $key;
    }
返回供查询的主键字段
复合主键或者没有主键直接抛出异常.

@return string