for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file contains functionality relating to database objects that have ELOs
*
* @package BZiON\Models
* @license https://github.com/allejo/bzion/blob/master/LICENSE.md GNU General Public License Version 3
*/
abstract class EloModel extends AvatarModel
{
protected $elo;
* Increase or decrease the ELO of the team
* @param int $adjust The value to be added to the current ELO (negative to substract)
public function changeElo($adjust)
$this->elo += $adjust;
$this->update('elo', $this->elo);
}
* Change the ELO of the team
* @param int $elo The new team ELO
public function setElo($elo)
$this->updateProperty($this->elo, 'elo', $elo);
* Get the current elo of the model
* @return int The elo of the model
public function getElo()
return $this->elo;