protected function ensureRequiredProperties(Entity $entity, array $properties): void
    {
        // Iterate through the required properties
        foreach ($entity::getRequiredProperties() as $requiredProperty) {
            // If the required property is not set
            if (! isset($properties[$requiredProperty])) {
                // Throw an exception
                throw new InvalidArgumentException('Missing required property: ' . $requiredProperty);
            }
        }
    }