当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseObject::__construct方法代码示例

本文整理汇总了PHP中DatabaseObject::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseObject::__construct方法的具体用法?PHP DatabaseObject::__construct怎么用?PHP DatabaseObject::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabaseObject的用法示例。


在下文中一共展示了DatabaseObject::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 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);
 }
开发者ID:vinnivinsachi,项目名称:Vincent-DR,代码行数:7,代码来源:CustomAttribute.php

示例2: __construct

 public function __construct()
 {
     // This is required or this constructor will override the
     // database object
     parent::__construct();
     $this->plans = new CustomerPlan();
 }
开发者ID:carriercomm,项目名称:Sipen-CMS,代码行数:7,代码来源:customer.class.php

示例3: __construct

 /**
  * 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);
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:12,代码来源:Spec.class.php

示例4: __construct

 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) . "'"));
 }
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:7,代码来源:RoItem.class.php

示例5: __construct

 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());
 }
开发者ID:sandin,项目名称:iMemo,代码行数:7,代码来源:NotesContent.php

示例6: __construct

 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);
 }
开发者ID:vinnivinsachi,项目名称:Vincent-DR,代码行数:26,代码来源:User.php

示例7: __construct

 /**
  * 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 = '" . escapeString($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);
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:35,代码来源:User.class.php

示例8: __construct

 /**
  * 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);
 }
开发者ID:Evil-Co-Legacy,项目名称:Evil-Co.de-CMS,代码行数:34,代码来源:Host.class.php

示例9: __construct

 /**
  * 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);
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:13,代码来源:ContestCouponParticipant.class.php

示例10: __construct

 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());
 }
开发者ID:sandin,项目名称:iMemo,代码行数:7,代码来源:NotesTags.php

示例11: __construct

 public function __construct($db)
 {
     parent::__construct($db, 'lds0019_notes_order', 'order_id');
     $this->add('note_id');
     $this->add('fronthand');
     $this->add('backhand');
 }
开发者ID:sandin,项目名称:iMemo,代码行数:7,代码来源:NotesOrder.php

示例12: __construct

 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/>";
 }
开发者ID:vinnivinsachi,项目名称:Vincent-DR,代码行数:35,代码来源:ImageBackUP.php

示例13: __construct

 public function __construct()
 {
     // This is required or this constructor will override the
     // database object
     parent::__construct();
     $this->orderby = "planid";
 }
开发者ID:carriercomm,项目名称:Sipen-CMS,代码行数:7,代码来源:planvariable.class.php

示例14: __construct

 public function __construct()
 {
     // This is required or this constructor will override the
     // database object
     parent::__construct();
     $this->loadSettings();
 }
开发者ID:carriercomm,项目名称:Sipen-CMS,代码行数:7,代码来源:setting.class.php

示例15: __construct

 /**
  * 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);
         }
     }
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:33,代码来源:NavalFormation.class.php


注:本文中的DatabaseObject::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。