minor bugfix

+ phpdoc improvements
This commit is contained in:
Steffen Schröder 2014-08-25 14:32:09 +02:00
parent cf5910a9b7
commit 7046335893

View File

@ -14,6 +14,9 @@ use ManiaControl\Utils\ClassUtil;
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class PlayerDataManager {
/*
* Constants
*/
const TABLE_PLAYERDATAMETADATA = 'mc_playerdata_metadata';
const TABLE_PLAYERDATA = 'mc_playerdata';
const TYPE_STRING = 'string';
@ -32,9 +35,9 @@ class PlayerDataManager {
private $storedData = array();
/**
* Construct player manager
* Construct a new player manager instance
*
* @param \ManiaControl\ManiaControl $maniaControl
* @param ManiaControl $maniaControl
*/
public function __construct(ManiaControl $maniaControl) {
$this->maniaControl = $maniaControl;
@ -234,7 +237,7 @@ class PlayerDataManager {
$dataStatement->store_result();
if ($dataStatement->num_rows <= 0) {
$this->setPlayerData($object, $dataName, $player, $meta->defaultValue, $serverIndex);
return $meta->default;
return $meta->defaultValue;
}
$dataStatement->bind_result($value);
$dataStatement->fetch();
@ -247,6 +250,7 @@ class PlayerDataManager {
$this->storedData[$player->index] = array();
}
$this->storedData[$player->index][$meta->dataId] = $data;
return $data;
}