refactor codestyle (chaining)

This commit is contained in:
kremsy
2014-08-13 11:05:52 +02:00
parent 699c5951d9
commit 22915bb934
56 changed files with 1572 additions and 3132 deletions

View File

@ -50,8 +50,7 @@ class PlayerDataManager {
* @return bool
*/
private function initTables() {
$mysqli = $this->maniaControl->getDatabase()
->getMysqli();
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
$defaultType = "'" . self::TYPE_STRING . "'";
$typeSet = $defaultType . ",'" . self::TYPE_INT . "','" . self::TYPE_REAL . "','" . self::TYPE_BOOL . "','" . self::TYPE_ARRAY . "'";
$query = "CREATE TABLE IF NOT EXISTS `" . self::TABLE_PLAYERDATAMETADATA . "` (
@ -104,8 +103,7 @@ class PlayerDataManager {
* Store Meta Data from the Database in the Ram
*/
private function storeMetaData() {
$mysqli = $this->maniaControl->getDatabase()
->getMysqli();
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
$query = "SELECT * FROM `" . self::TABLE_PLAYERDATAMETADATA . "`;";
$result = $mysqli->query($query);
@ -139,8 +137,7 @@ class PlayerDataManager {
* @return bool
*/
public function defineMetaData($object, $dataName, $default, $dataDescription = '') {
$mysqli = $this->maniaControl->getDatabase()
->getMysqli();
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
$className = ClassUtil::getClass($object);
$query = "INSERT INTO `" . self::TABLE_PLAYERDATAMETADATA . "` (
@ -218,8 +215,7 @@ class PlayerDataManager {
return $this->storedData[$player->index][$meta->dataId];
}
$mysqli = $this->maniaControl->getDatabase()
->getMysqli();
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
$dataQuery = "SELECT `value` FROM `" . self::TABLE_PLAYERDATA . "`
WHERE `dataId` = ?
AND `playerId` = ?
@ -275,8 +271,7 @@ class PlayerDataManager {
return false;
}
$mysqli = $this->maniaControl->getDatabase()
->getMysqli();
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
$query = "INSERT INTO `" . self::TABLE_PLAYERDATA . "` (
`serverIndex`,
`playerId`,