/** * {@inheritdoc} * This method also checks whether the player is online. */ public function isValid() { return parent::isValid() and $this->player instanceof Player and $this->player->isOnline(); }