/** * @param PitcherObject $pitcherObject */ public function update($pitcherObject) { $oldData = $this->read($pitcherObject->getId()); $this->players_id = $pitcherObject->getPlayersId() !== null ? parent::cleanData($pitcherObject->getPlayersId()) : $oldData->getPlayersId(); $this->win = $pitcherObject->getWin() !== null ? parent::cleanData($pitcherObject->getWin()) : $oldData->getWin(); $this->loss = $pitcherObject->getLoss() !== null ? parent::cleanData($pitcherObject->getLoss()) : $oldData->getLoss(); $this->era = $pitcherObject->getEra() !== null ? parent::cleanData($pitcherObject->getEra()) : $oldData->getEra(); $this->innings_pitched = $pitcherObject->getInningsPitched() !== null ? parent::cleanData($pitcherObject->getInningsPitched()) : $oldData->getInningsPitched(); $this->runs_allowed = $pitcherObject->getRunsAllowed() !== null ? parent::cleanData($pitcherObject->getRunsAllowed()) : $oldData->getRunsAllowed(); $this->earned_runs_allowed = $pitcherObject->getEarnedRunsAllowed() !== null ? parent::cleanData($pitcherObject->getEarnedRunsAllowed()) : $oldData->getEarnedRunsAllowed(); $this->walks_allowed = $pitcherObject->getWalksAllowed() !== null ? parent::cleanData($pitcherObject->getWalksAllowed()) : $oldData->getWalksAllowed(); $this->strike_outs = $pitcherObject->getStrikeOuts() !== null ? parent::cleanData($pitcherObject->getStrikeOuts()) : $oldData->getStrikeOuts(); $this->updateStatement->execute(); }