/** * @param League $league * @param bool $autoUpdate if true - update league info if league exists in the DB */ public function save(League $league, $autoUpdate = true) { if (self::leagueExists($league->get('leagueid'))) { if ($autoUpdate) { $this->update($league); } } else { $this->insert($league); } }