public function getAttack($playerHash, $countryIdFrom, $countryIdTo) { $from = Country::find($countryIdFrom); /** @var $from Country */ $to = Country::find($countryIdTo); $player = Player::getByHash($playerHash); if ($from->isOwnedBy($player)) { Action::attack($from, $to); } }