12 const TABLE_NAME =
"Match_Round";
15 public $IdMatchAccount = 0;
17 public $DateScore = NULL;
22 public function __construct($src = null, $stripSlashes =
false) {
28 $this->_loadByRow($src, $stripSlashes);
29 }
else if (is_numeric($src) && intval($src) > 0) {
31 $this->_loadFilter(self::GetTableName(__CLASS__),
"Id = " . intval($src));
41 public static function Load($idMatchAccount = 0) {
44 if ($idMatchAccount > 0) {
45 $where .= ($where ==
"" ?
"" :
" AND ") . sprintf(
"(IdMatchAccount = %d)", $idMatchAccount);
47 return self::_load(self::GetTableName(__CLASS__), __CLASS__, $where);
58 $query = sprintf(
"UPDATE %s SET Score = %f, DateScore = %s WHERE Id = %d",
59 self::GetTableName(__CLASS__),
61 $Database->EscapeDate($this->DateScore),
64 $this->DateCreation = date(
"Y-m-d H:i:s");
65 $query = sprintf(
"INSERT INTO %s (IdMatchAccount, Score, DateScore) VALUES (%d, %f, %s)",
66 self::GetTableName(__CLASS__),
67 $this->IdMatchAccount,
69 $Database->EscapeDate($this->DateScore));
71 if ($Database->Query($query)) {
73 $this->Id = $Database->InsertedId();
86 if ($this->_Delete(self::GetTableName(__CLASS__),
"Id = " . $this->Id)) {
87 $this->_Delete(self::GetTableName(GameMatch_CustomData::class),
"IdMatch = " . $this->Id);
88 $this->_Delete(self::GetTableName(GameMatch_Account::class),
"IdMatch = " . $this->Id);
__construct($src=null, $stripSlashes=false)
static Load($idMatchAccount=0)