mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
* cache $db->hasTable and $db->hasColumn functions
* changed tableExist and fieldExist to $db->hasTable(table) + $db->hasColumn(table, column) * new configurable: database_log - can log database queries and show in website source when logged as super admin * removed debug_level configurable, enabled by default when logged on super admin * added OTS_Account:getCountry() * added posibility to load OTS_Player partially, and without skills * (internal) changed depracated $ots->createObject() functions with their OTS_ equivalents * (internal) removed unused code
This commit is contained in:
@@ -122,13 +122,13 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
public function load($id)
|
||||
{
|
||||
$ownerid = 'ownerid';
|
||||
if(fieldExist('owner_id', 'guilds'))
|
||||
if($this->db->hasColumn('guilds', 'owner_id'))
|
||||
$ownerid = 'owner_id';
|
||||
|
||||
$creationdata = 'creationdata';
|
||||
if(fieldExist('creationdate', 'guilds'))
|
||||
if($this->db->hasColumn('guilds', 'creationdate'))
|
||||
$creationdata = 'creationdate';
|
||||
else if(fieldExist('creation_time', 'guilds'))
|
||||
else if($this->db->hasColumn('guilds', 'creation_time'))
|
||||
$creationdata = 'creation_time';
|
||||
|
||||
// SELECT query on database
|
||||
@@ -177,13 +177,13 @@ class OTS_Guild extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
public function save()
|
||||
{
|
||||
$ownerid = 'ownerid';
|
||||
if(fieldExist('owner_id', 'guilds'))
|
||||
if($this->db->hasColumn('guilds', 'owner_id'))
|
||||
$ownerid = 'owner_id';
|
||||
|
||||
$creationdata = 'creationdata';
|
||||
if(fieldExist('creationdate', 'guilds'))
|
||||
if($this->db->hasColumn('guilds', 'creationdate'))
|
||||
$creationdata = 'creationdate';
|
||||
else if(fieldExist('creation_time', 'guilds'))
|
||||
else if($this->db->hasColumn('guilds', 'creation_time'))
|
||||
$creationdata = 'creation_time';
|
||||
|
||||
// updates existing guild
|
||||
|
Reference in New Issue
Block a user