| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace App\Module\Farm\Events;
- use App\Module\Farm\Models\FarmLand;
- use App\Module\Farm\Models\FarmUpgradeLog;
- use Illuminate\Broadcasting\InteractsWithSockets;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Queue\SerializesModels;
- /**
- * 土地升级事件
- *
- * 当用户升级土地时触发
- */
- class LandUpgradedEvent
- {
- use Dispatchable, InteractsWithSockets, SerializesModels;
- /**
- * 用户ID
- *
- * @var int
- */
- public $userId;
- /**
- * 土地信息
- *
- * @var FarmLand
- */
- public $land;
- /**
- * 旧土地类型
- *
- * @var int
- */
- public $oldType;
- /**
- * 新土地类型
- *
- * @var int
- */
- public $newType;
- /**
- * 升级记录
- *
- * @var FarmUpgradeLog
- */
- public $upgradeLog;
- /**
- * 创建一个新的事件实例
- *
- * @param int $userId
- * @param FarmLand $land
- * @param int $oldType
- * @param int $newType
- * @param FarmUpgradeLog $upgradeLog
- * @return void
- */
- public function __construct(
- int $userId,
- FarmLand $land,
- int $oldType,
- int $newType,
- FarmUpgradeLog $upgradeLog
- ) {
- $this->userId = $userId;
- $this->land = $land;
- $this->oldType = $oldType;
- $this->newType = $newType;
- $this->upgradeLog = $upgradeLog;
- }
- }
|