public function __construct($db, $table) { parent::__construct($db, $table, 'id'); $this->add('name_of_set'); $this->add('uploader_id'); $this->add('ts_created', time(), self::TYPE_TIMESTAMP); }
public function __construct() { // This is required or this constructor will override the // database object parent::__construct(); $this->plans = new CustomerPlan(); }
/** * Creates a new Spec object. * * @param spec id */ public function __construct($specID, $row = null) { if ($row === null) { $row = self::$cache['bySpecID'][$specID]; } parent::__construct($row); }
public function __construct(array $row) { $this->_Params = array('id' => 'ID', 'item_id' => 'ItemID', 'hash' => 'Hash', 'name' => 'Name', 'price' => 'PriceAll', 'price_one' => 'Price', 'amount' => 'Amount', 'refine' => 'Refine', 'slot0' => 'Slot0', 'slot1' => 'Slot1', 'slot2' => 'Slot2', 'slot3' => 'Slot3', 'avg_all' => 'AvgAll', 'name_url' => 'NameUrl', 'vender_id' => 'VenderID', 'description_en' => 'DescriptionEN', 'description_fr' => 'DescriptionFR'); parent::__construct($row); $this->NameUrl = self::cleanName($this->Name); $this->Vender = new RoVender(Framework::getDb()->getFirstRow("SELECT * FROM bot_vender WHERE char_id = '" . esc($this->VenderID) . "'")); }
public function __construct($db) { parent::__construct($db, 'lds0019_notes_content', 'content_id'); $this->add('note_id'); $this->add('content', null); $this->add('ts_modified', time()); }
public function __construct($db) { parent::__construct($db, 'users', 'userID'); $this->add('referral_id'); $this->add('referee_id', Text_Password::create(10, 'unpronounceable')); $this->add('username'); $this->add('password'); $this->add('email'); $this->add('sex'); $this->add('first_name'); $this->add('last_name'); $this->add('user_type', 'member'); $this->add('reward_point', 0); $this->add('status', 'D'); $this->add('measurement', '0'); $this->add('review_count', '0'); $this->add('review_average_score', '0'); $this->add('review_total_score', '0'); $this->add('verification', 'unverified'); $this->add('ts_created', time(), self::TYPE_TIMESTAMP); $this->add('ts_last_login', null, self::TYPE_TIMESTAMP); $this->profile = new Profile_User($db); $this->shippingObject = new DatabaseObject_ShippingAddress($db); $this->accountBalanceSummary = new DatabaseObject_Account_UserAccountBalanceSummary($db); //$this->defaultShippingAddress = new DatabaseObject_ShippingAddress($db); }
/** * Gets the main data of the passed user (id, name or whole datablock) * and pass it over to the "protected function initUser()". * You can also create an emtpy user object e.g. to search for users. * * @param string $userID * @param array $row * @param string $username * @param string $email */ public function __construct($userID, $row = null, $username = null, $email = null) { // set sql join to user_data table $this->sqlSelects .= 'user_option.*,'; $this->sqlJoins .= "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option ON (user_option.userID = user.userID)"; // execute sql statement $sqlCondition = ''; if ($userID !== null) { $sqlCondition = "user.userID = " . $userID; } else { if ($username !== null) { $sqlCondition = "user.username = '******'"; } else { if ($email !== null) { $sqlCondition = "user.email = '" . escapeString($email) . "'"; } } } if (!empty($sqlCondition)) { $sql = "SELECT \t" . $this->sqlSelects . "\n\t\t\t\t\tuser.*\n\t\t\t\tFROM \twcf" . WCF_N . "_user user\n\t\t\t\t\t" . $this->sqlJoins . "\n\t\t\t\tWHERE \t" . $sqlCondition . $this->sqlGroupBy; $row = WCF::getDB()->getFirstRow($sql); } // handle result set parent::__construct($row); }
/** * Reads a host row from database * @param integer $hostID * @param array $row * @param string $host */ public function __construct($hostID, $row = null, $host = null, $languageCode = null) { $this->sqlSelects .= 'host.*'; // create sql conditions $sqlCondition = ''; if ($hostID !== null) { $sqlCondition .= "host.hostID = " . $hostID; } if ($host !== null) { if (!empty($sqlCondition)) { $sqlCondition .= " AND "; } $sqlCondition .= "host.hostname = '" . escapeString($host) . "'"; } if ($languageCode !== null) { if (!empty($sqlCondition)) { $sqlCondition .= " AND "; } $sqlCondition .= "host.languageCode = '" . escapeString($languageCode) . "'"; } // execute sql statement if (!empty($sqlCondition)) { $sql = "SELECT \t" . $this->sqlSelects . "\r\n\t\t\t\tFROM \twcf" . WCF_N . "_host host\r\n\t\t\t\t\t" . $this->sqlJoins . "\r\n\t\t\t\tWHERE \t" . $sqlCondition . $this->sqlGroupBy; $row = WCF::getDB()->getFirstRow($sql); } // handle result set parent::__construct($row); }
/** * Creates a new object. * * @param integer $id * @param array<mixed> $row */ public function __construct($id, $row = null) { if ($id !== null) { throw new SystemException('not implemented'); } parent::__construct($row); }
public function __construct($db) { parent::__construct($db, 'lds0019_notes_tags', 'tag_id'); $this->add('tag_name'); $this->add('user_id'); $this->add('ts_created', time()); }
public function __construct($db) { parent::__construct($db, 'lds0019_notes_order', 'order_id'); $this->add('note_id'); $this->add('fronthand'); $this->add('backhand'); }
public function __construct($db) { if ($_SESSION['categoryType'] == 'post') { $this->databaseColumn = 'post_id'; $this->table = 'blog_posts_images'; parent::__construct($db, 'blog_posts_images', 'image_id'); } if ($_SESSION['categoryType'] == 'product') { $this->databaseColumn = 'product_id'; $this->table = 'products_images'; parent::__construct($db, 'products_images', 'image_id'); } if ($_SESSION['categoryType'] == 'clubImage') { $this->databaseColumn = 'user_id'; $this->table = 'users_profiles_images'; parent::__construct($db, 'users_profiles_images', 'image_id'); } if ($_SESSION['categoryType'] == 'event') { $this->databaseColumn = 'event_id'; $this->table = 'events_images'; parent::__construct($db, 'events_images', 'image_id'); } if ($_SESSION['categoryType'] == 'universalDueImage') { $this->databaseColumn = 'universal_dues_id'; $this->table = 'universal_dues_images'; parent::__construct($db, 'universal_dues_images', 'image_id'); } $this->add('filename'); $this->add($this->databaseColumn); $this->add('ranking'); //$this->add('username'); //echo $this->username; //echo $this->_table."<br/>"; //echo $this->databaseColumn."<br/>"; }
public function __construct() { // This is required or this constructor will override the // database object parent::__construct(); $this->orderby = "planid"; }
public function __construct() { // This is required or this constructor will override the // database object parent::__construct(); $this->loadSettings(); }
/** * Creates a new NavalFormation object. * * @param int nf id * @param array db row */ public function __construct($navalFormationID, $row = null) { if ($row === null) { $sql = "SELECT ugml_naval_formation.*,\r\n\t\t \t\t\tGROUP_CONCAT(\r\n\t\t \t\t\t\tCONCAT(ugml_naval_formation_to_users.userID, ',', ugml_naval_formation_to_users.joinTime)\r\n\t\t \t\t\t\tSEPARATOR ';')\r\n\t\t \t\t\tAS users,\r\n\t\t \t\t\tGROUP_CONCAT(\r\n\t\t \t\t\t\tCONCAT(ugml_fleet.ownerID, ',', ugml_fleet.fleetID)\r\n\t\t \t\t\t\tSEPARATOR ';')\r\n\t\t \t\t\tAS fleets\r\n\t\t\t\t\tFROM ugml_naval_formation\r\n\t\t\t\t\tLEFT JOIN ugml_naval_formation_to_users\r\n\t\t\t\t\t\tON ugml_naval_formation.formationID = ugml_naval_formation_to_users.formationID\r\n\t\t\t\t\tLEFT JOIN ugml_fleet\r\n\t\t\t\t\t\tON ugml_naval_formation.formationID = ugml_fleet.formationID\r\n\t\t\t\t\tWHERE ugml_naval_formation.formationID = " . $navalFormationID . "\r\n\t\t\t\t\tGROUP BY ugml_naval_formation.formationID"; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); // create users array $parts = explode(';', $this->data['users']); foreach ($parts as $part) { if (strlen($part) > 2) { list($userID, $joinTime) = explode(',', $part); if (!isset($this->users[$userID])) { $this->users[$userID] = new LWUser($userID); $this->users[$userID]->joinTime = $joinTime; } } } // create fleets array $parts = explode(';', $this->data['fleets']); foreach ($parts as $part) { if (strlen($part) > 2) { list($userID, $fleetID) = explode(',', $part); $this->fleets[$fleetID] = Fleet::getInstance($fleetID); } } }
/** * Creates a new ViewableContest object. * * @param integer $sponsorID * @param array<mixed> $row */ public function __construct($sponsorID, $row = null) { if ($sponsorID !== null) { $sql = "SELECT\t\tavatar_table.*, \n\t\t\t\t\t\tcontest_sponsor.*,\n\t\t\t\t\t\tuser_table.username, \n\t\t\t\t\t\tgroup_table.groupName\n\t\t\t\tFROM \t\twcf" . WCF_N . "_contest_sponsor contest_sponsor\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_user user_table\n\t\t\t\tON\t\t(user_table.userID = contest_sponsor.userID)\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_avatar avatar_table\n\t\t\t\tON\t\t(avatar_table.avatarID = user_table.avatarID)\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_group group_table\n\t\t\t\tON\t\t(group_table.groupID = contest_sponsor.groupID)\n\t\t\t\tWHERE \t\tcontest_sponsor.sponsorID = " . intval($sponsorID) . "\n\t\t\t\tAND\t\t(" . ContestSponsor::getStateConditions() . ")"; $row = WCF::getDB()->getFirstRow($sql); } DatabaseObject::__construct($row); }
/** * Creates a new News object. * * @param int news id * @param array row data */ public function __construct($newsID, $row = null) { if ($row === null) { $sql = "SELECT *\n\t\t\t\t\tFROM ugml_news\n\t\t\t\t\tWHERE newsID = " . $newsID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new TemplatePack object. * * @param integer $templatePackID * @param array<mixed> $row */ public function __construct($templatePackID, $row = null) { if ($templatePackID !== null) { $sql = "SELECT\t*\n\t\t\t\tFROM\twcf" . WCF_N . "_template_pack\n\t\t\t\tWHERE\ttemplatePackID = " . $templatePackID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new Suspension object. * * @param integer $suspensionID * @param array<mixed> $row */ public function __construct($suspensionID, $row = null) { if ($suspensionID !== null) { $sql = "SELECT\tsuspension.*,\n\t\t\t\t\t(SELECT COUNT(*) FROM wcf" . WCF_N . "_user_infraction_suspension_to_user WHERE suspensionID = suspension.suspensionID) AS suspensions\n\t\t\t\tFROM\twcf" . WCF_N . "_user_infraction_suspension suspension\n\t\t\t\tWHERE\tsuspension.suspensionID = " . $suspensionID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a Loggable object. * * @param integer $loggableID * @param array $row */ public function __construct($loggableID, $row = null) { if ($loggableID !== null) { $sql = "SELECT\t*\n\t\t\t\tFROM\twcf" . WCF_N . "_actionlog_loggable\n\t\t\t\tWHERE\tloggableID = " . intval($loggableID); $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new Entry object. * * @param integer $entryID * @param array $row * @param integer $messageID */ public function __construct($entryID, $row = null, $messageID = null) { if ($entryID !== null || $messageID !== null && $messageID !== 0) { $sql = "SELECT\t\tentry.*,\n\t\t\t\t\t\tlanguagePokemonName.languageItemValue AS pokemonName,\n\t\t\t\t\t\tlanguageBallName.languageItemValue AS ballName,\n\t\t\t\t\t\tmessage.*\n\t\t\t\tFROM\t\twcf" . WCF_N . "_cheat_database_entry entry\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_language_item languagePokemonName\n\t\t\t\tON\t\t(languagePokemonName.languageItem = CONCAT('wcf.cheatDatabase.entry.pokemon.', entry.pokedexNumber, '.', entry.form))\n\t\t\t\t\t\tAND (languagePokemonName.languageID = " . WCF::getUser()->languageID . ")\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_language_item languageBallName\n\t\t\t\tON\t\t(languageBallName.languageItem = CONCAT('wcf.cheatDatabase.entry.ball.', entry.ball))\n\t\t\t\t\t\tAND (languageBallName.languageID = " . WCF::getUser()->languageID . ")\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_cheat_database_entry_message message\n\t\t\t\tON \t\t(entry.messageID = message.messageID)\n\t\t\t\tWHERE\t\t" . ($messageID !== null && $messageID !== 0 ? "entry.messageID = " . $messageID : "entry.entryID = " . $entryID); $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new ViewableContest object. * * @param integer $eventID * @param array<mixed> $row */ public function __construct($eventID, $row = null) { if ($eventID !== null) { $sql = "SELECT\t\tavatar_table.*, \n\t\t\t\t\t\tcontest_event.*,\n\t\t\t\t\t\tuser_table.username, \n\t\t\t\t\t\tgroup_table.groupName\n\t\t\t\tFROM \t\twcf" . WCF_N . "_contest_event contest_event\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_user user_table\n\t\t\t\tON\t\t(user_table.userID = contest_event.userID)\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_avatar avatar_table\n\t\t\t\tON\t\t(avatar_table.avatarID = user_table.avatarID)\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_group group_table\n\t\t\t\tON\t\t(group_table.groupID = contest_event.groupID)\n\t\t\t\tWHERE \t\tcontest_event.eventID = " . intval($eventID); $row = WCF::getDB()->getFirstRow($sql); } DatabaseObject::__construct($row); }
/** * Creates a new SessionAccessLog object. * * @param integer $sessionAccessLogID * @param array<mixed> $row */ public function __construct($sessionAccessLogID, $row = null) { if ($sessionAccessLogID !== null) { $sql = "SELECT\t*\n\t\t\t\tFROM\twcf" . WCF_N . "_acp_session_access_log\n\t\t\t\tWHERE\tsessionAccessLogID = " . $sessionAccessLogID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new ContestSolutionRating object. * * @param integer $ratingID * @param array<mixed> $row */ public function __construct($ratingID, $row = null) { if ($ratingID !== null) { $sql = "SELECT\t\t*\n\t\t\t\tFROM \t\twcf" . WCF_N . "_contest_solution_rating\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_contest_jury contest_jury\n\t\t\t\tON\t\t(contest_jury.juryID = contest_jury.juryID)\n\t\t\t\tWHERE \t\tratingID = " . intval($ratingID); $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new Warning object. * * @param integer $warningID * @param array<mixed> $row */ public function __construct($warningID, $row = null) { if ($warningID !== null) { $sql = "SELECT\twarning.*,\n\t\t\t\t\t(SELECT COUNT(*) FROM wcf" . WCF_N . "_user_infraction_warning_to_user WHERE warningID = warning.warningID) AS warnings\n\t\t\t\tFROM\twcf" . WCF_N . "_user_infraction_warning warning\n\t\t\t\tWHERE\twarning.warningID = " . $warningID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new HelpItem object. * * @param integer $helpItemID * @param array $row */ public function __construct($helpItemID, $row = null) { if ($helpItemID !== null) { $sql = "SELECT\t*\n\t\t\t\tFROM\twcf" . WCF_N . "_help_item\n\t\t\t\tWHERE\thelpItemID = " . $helpItemID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new EntryRibbon object. * * @param integer $entryID * @param integer $ribbonID * @param array $row */ public function __construct($entryID, $ribbonID, $row = null) { if ($entryID !== null && $ribbonID !== null) { $sql = "SELECT\t\tribbon.*,\n\t\t\t\t\t\tlanguageRibbonName.languageItemValue AS ribbonName\n\t\t\t\tFROM\t\twcf" . WCF_N . "_cheat_database_ribbon_to_entry ribbon\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_language_item languageRibbonName\n\t\t\t\tON\t\t(languageRibbonName.languageItem = CONCAT('wcf.cheatDatabase.entry.ribbon.', ribbon.ribbonID))\n\t\t\t\t\t\tAND (languageRibbonName.languageID = " . WCF::getUser()->languageID . ")\n\t\t\t\tWHERE\t\tribbon.entryID = " . $entryID . "\n\t\t\t\t\t\tAND ribbon.ribbonID = " . $ribbonID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new ContestSolution object. * * @param integer $solutionID * @param array<mixed> $row */ public function __construct($solutionID, $row = null) { if ($solutionID !== null) { $sql = "SELECT\t\tcontest_solution.*,\n\t\t\t\t\t\tcontest_price.priceID,\n\t\t\t\t\t\tcontest_participant.userID, \n\t\t\t\t\t\tcontest_participant.groupID\n\t\t\t\tFROM \t\twcf" . WCF_N . "_contest_solution contest_solution\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_contest_participant contest_participant\n\t\t\t\tON\t\tcontest_participant.participantID = contest_solution.participantID\n\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_contest_price contest_price\n\t\t\t\tON\t\tcontest_price.contestID = contest_solution.contestID\n\t\t\t\tAND\t\tcontest_price.solutionID = contest_solution.solutionID\n\n\t\t\t\tWHERE \t\tcontest_solution.solutionID = " . intval($solutionID); $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new Attachment object. * * @param integer $attachmentID * @param array<mixed> $row */ public function __construct($attachmentID, $row = null) { if ($attachmentID !== null) { $sql = "SELECT\t*\n\t\t\t\tFROM\twcf" . WCF_N . "_attachment\n\t\t\t\tWHERE\tattachmentID = " . $attachmentID; $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }
/** * Creates a new ContestJury object. * * @param integer $juryID * @param array<mixed> $row */ public function __construct($juryID, $row = null) { if ($juryID !== null) { $sql = "SELECT\t\t*, \n\t\t\t\t\t\tIF(\n\t\t\t\t\t\t\tcontest_jury.groupID > 0, \n\t\t\t\t\t\t\twcf_group.groupName, \n\t\t\t\t\t\t\twcf_user.username\n\t\t\t\t\t\t) AS title\n\t\t\t\tFROM\t\twcf" . WCF_N . "_contest_jury contest_jury\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_user wcf_user\n\t\t\t\tON\t\t(wcf_user.userID = contest_jury.userID)\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_group wcf_group\n\t\t\t\tON\t\t(wcf_group.groupID = contest_jury.groupID)\n\t\t\t\tWHERE\t\tcontest_jury.juryID = " . intval($juryID); $row = WCF::getDB()->getFirstRow($sql); } parent::__construct($row); }