12 const TABLE_NAME =
"Tournament_CustomData";
14 public $IdTournament = 0;
16 public $DataValue =
"";
21 public function __construct($src = null, $stripSlashes =
false) {
26 $this->_loadByRow($src, $stripSlashes);
37 public static function Load ($idTournament, $returnArray =
false) {
38 $where = sprintf(
"IdTournament = %d", $idTournament);
39 return self::_load(self::GetTableName(__CLASS__), ($returnArray ?
"" : __CLASS__), $where);
49 $query = sprintf(
"REPLACE INTO %s (IdTournament, DataKey, DataValue) VALUES (%d, '%s', '%s')",
50 self::GetTableName(__CLASS__),
52 $Database->Escape($this->DataKey),
53 $Database->Escape($this->DataValue));
54 return $Database->Query($query);
64 if ($this->IdTournament > 0 && $this->DataKey) {
65 return $this->_Delete(self::GetTableName(__CLASS__), sprintf(
"IdTournament = %d AND DataKey = '%s'", $this->IdTournament, $Database->Escape($this->DataKey)));
static Load($idTournament, $returnArray=false)
__construct($src=null, $stripSlashes=false)