Save multiple player models at the tume

@param Player[] $players

@throws PropelException
185195
public function saveAll($players)
    {
        $connection = Propel::getWriteConnection(PlayerTableMap::DATABASE_NAME);
        $connection->beginTransaction();

        foreach ($players as $record) {
            $this->save($record);
        }

        $connection->commit();
        PlayerTableMap::clearInstancePool();
    }
1004082
public void setPlayerSessions(java.util.Collection<PlayerSession> playerSessions) {
        if (playerSessions == null) {
            this.playerSessions = null;
            return;
        }

        this.playerSessions = new java.util.ArrayList<PlayerSession>(playerSessions);
    }
1106293
public function saveRoles($inputRoles)
    {
        if (!empty($inputRoles)) {
            $this->roles()->sync($inputRoles);
        } else {
            $this->roles()->detach();
        }
    }
1348379
public function playerFoldsHand(PlayerContract $player)
    {
        $this->checkPlayerTryingToAct($player);

        $this->actions()->push(new Action($player, Action::FOLD));

        $this->foldedPlayers->push($player);
        $this->leftToAct = $this->leftToAct()->removePlayer($player);
    }
295213
def _players(self):
        """"""
        for i in range(1, self._header.replay.num_players):
            yield i, self._header.initial.players[i].attributes
1099522
public function setMinPlays($minPlays)
    {
        if (is_int($minPlays) === true && $minPlays >= 0) {
            $this->minPlays = $minPlays;
        } else {
            $msg = "The 'minPlays' argument must be a positive (>= 0) integer, '" . gettype($minPlays) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
363514
public function save(Player $player)
    {
        if (self::playerExists($player->get('steamid'))) {
            $this->update($player);
        } else {
            $this->insert($player);
        }
    }
1208179
def players(self, postgame, game_type):
        """"""
        for i, attributes in self._players():
            yield self._parse_player(i, attributes, postgame, game_type)
241925
public function saveMultiple(array $objects)
    {
        array_walk($objects, [$this, 'assertObjectInstance']);

        return $this->manager
            ->getDriver()
            ->inTransaction(
                function (Driver $driver, array $objects) {
                    return array_map([$this, 'save'], $objects);
                },
                $objects
            );
    }
934656
public function addPlayer(Player $player)
    {
        $count = $this->getTotalPlayers();
        
        // give player a name if they dont have one
        if (empty($player->getName())) {
            $player->setName(self::DEFAULT_PLAYER_NAME_PREFIX . ($count + 1)); // we add 1 since $count is an array pointer
        }
        
        // we set an id to make it easier to generate results later
        $player->setId($count + 1);
        
        $this->players[$count] = $player;
        
        return $this;
    }
972023
function setMaxPlayers($maxPlayers, $multicall = false)
    {
        if (!is_int($maxPlayers)) {
            throw new InvalidArgumentException('maxPlayers = ' . print_r($maxPlayers, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($maxPlayers), $multicall);
    }
562374
public function setPlayer($player)
    {
        self::$xml['player'] = '<media:player';

        $this->writeAttribute(
            $player,
            'player',
            'url',
            $this->validator,
            'validatePlayer',
            $this->exception,
            'Provided player URL is not a valid value.'
        );

        self::$xml['player'] .= ' />';

        return $this;
    }
542646
private function getOpponentPlayer($player)
    {
        if (!in_array($player, $this->players)) {
            return false;
        }

        $opponentArray = array_diff($this->players, [$player]);

        return array_shift($opponentArray);
    }
1079481
public function setActivity($player, int $activity): self
    {
        // var_dump($this);
        $result = $this
            ->filter(function ($array) use ($player) {
                return $array['player'] === $player;
            })
        ;

        $array = $result->first();
        $array['action'] = $activity;
        $this->put($result->keys()->first(), $array);

        return self::make($this->values()->toArray());
    }
146976
public function canFeedOpponent($player)
    {
        if (0 === $player) {
            for ($i = 0; $i < 6; $i++) {
                if ($this->grid[0]['seeds'][$i] > $i) {
                    return true;
                }
            }
        }

        if (1 === $player) {
            for ($i = 0; $i < 6; $i++) {
                if ($this->grid[1]['seeds'][$i] > (5 - $i)) {
                    return true;
                }
            }
        }

        return false;
    }
72937
def player
      PLAYERS.each do |player|
        player_load(player) || next

        instance = player_class(player).new
        player_on_platform?(instance) || next

        return instance if player_launched?(instance)
      end
      nil
    end
1316513
public function onVotePassed(Player $player, $cmdName, $cmdValue)
    {
        if ($cmdValue instanceof Vote) {
            $this->voteWidgetFactory->destroy($this->players);
            $this->updateVoteWidgetFactory->destroy($this->players);
        }
    }