src/Leevel/Database/Ddd/Entity.php
public static function event(string $event, $listener): void
    {
        if (null === static::$leevelDispatch &&
            static::lazyloadPlaceholder() && null === static::$leevelDispatch) {
            return;
        }

        static::isSupportEvent($event);

        static::$leevelDispatch->register(
            "entity.{$event}:".static::class,
            $listener
        );
    }
public static function event(string $event, $listener): void
    {
        if (null === static::$leevelDispatch &&
            static::lazyloadPlaceholder() && null === static::$leevelDispatch) {
            return;
        }

        static::isSupportEvent($event);

        static::$leevelDispatch->register(
            "entity.{$event}:".static::class,
            $listener
        );
    }
注册模型实体事件.

@param string                                 $event
@param \Closure|\Leevel\Event\Observer|string $listener