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


PHP Item::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($meta = 0, $count = 1)
 {
     parent::__construct(self::COAL, $meta, $count, "Coal");
     if ($this->meta === 1) {
         $this->name = "Charcoal";
     }
 }
开发者ID:mattiasaxelsson,项目名称:PocketMine-MP,代码行数:7,代码来源:Coal.php

示例2: __construct

 public function __construct($variableName, $type, $title)
 {
     parent::__construct();
     $this->variableName = $variableName;
     $this->type = $type;
     $this->title = $title;
 }
开发者ID:appshed,项目名称:extension-api,代码行数:7,代码来源:Picker.php

示例3: __construct

 public function __construct($id = false, $style_sd = false)
 {
     global $bd_names, $site_ways;
     parent::__construct($id, ItemType::Skin, $bd_names['sp_skins'], $style_sd);
     $this->base_dir = MCR_ROOT . $site_ways['sp_dir'] . 'skins/';
     $this->base_url = $site_ways['sp_dir'] . 'skins/';
     $this->db_likes = $bd_names['likes'];
     $this->db_bad_skins = $bd_names['sp_bad_skins'];
     $this->db_ratio = $bd_names['sp_skins_ratio'];
     if (!$this->id) {
         return;
     }
     $line = getDB()->fetchRow("SELECT * FROM `{$this->db}` WHERE `id`='" . $this->id . "'");
     if (!$line) {
         return;
     }
     $this->name = $line['name'];
     $this->fname = $line['fname'];
     $this->fsize = $line['fsize'];
     $this->dislikes = (int) $line['dislikes'];
     $this->likes = (int) $line['likes'];
     $this->ratio = (int) $line['ratio'];
     // @todo rename to scale
     $this->gender = (int) $line['gender'];
     $this->downloads = (int) $line['downloads'];
     $this->comments = (int) $line['comments'];
     $this->user_id = (int) $line['user_id'];
     $this->comment_last = $line['comment_last'] === '0000-00-00 00:00:00' ? false : $line['comment_last'];
 }
开发者ID:saneriner,项目名称:webMCR-SkinPoser,代码行数:29,代码来源:skinposer.class.php

示例4: __construct

 public function __construct($name, array $data)
 {
     parent::__construct($name, $data);
     foreach ($data['values'] as $value) {
         $this->values[] = new AspectValue($value['name'], $value);
     }
 }
开发者ID:meniam,项目名称:ebay-api-client,代码行数:7,代码来源:AspectName.php

示例5: __construct

 /**
  * Create a property, either from server data or locally
  *
  * To indicate a property has newly been created locally, make sure to pass
  * true for the $new parameter.
  *
  * @param object $factory  an object factory implementing "get" as described in \jackalope\Factory
  * @param array $data array with fields
  *                    type (integer or string from PropertyType)
  *                    and value (data for creating value object - array for multivalue property)
  * @param string $path the absolute path of this item
  * @param Session the session instance
  * @param ObjectManager the objectmanager instance - the caller has to take care of registering this item with the object manager
  * @param boolean $new optional: set to true to make this property aware its not yet existing on the server. defaults to false
  */
 public function __construct($factory, array $data, $path, Session $session, ObjectManager $objectManager, $new = false)
 {
     parent::__construct($factory, $path, $session, $objectManager, $new);
     $type = $data['type'];
     if (is_string($type)) {
         $type = \PHPCR\PropertyType::valueFromName($type);
     } elseif (!is_numeric($type)) {
         throw new \PHPCR\RepositoryException("INTERNAL ERROR -- No valid type specified ({$type})");
     } else {
         //sanity check. this will throw InvalidArgumentException if $type is not a valid type
         \PHPCR\PropertyType::nameFromValue($type);
     }
     $this->type = $type;
     if (is_array($data['value'])) {
         $this->isMultiple = true;
         $this->value = array();
         foreach ($data['value'] as $value) {
             $this->value[] = Helper::convertType($value, $type);
         }
     } elseif (null !== $data['value']) {
         $this->value = Helper::convertType($data['value'], $type);
     } else {
         throw new \PHPCR\RepositoryException('INTERNAL ERROR -- data[value] may not be null');
     }
 }
开发者ID:rambo,项目名称:jackalope,代码行数:40,代码来源:Property.php

示例6: Server

 public function Server($id = false, $style_sd = false)
 {
     global $bd_names;
     parent::__construct($id, ItemType::Server, $bd_names['servers'], $style_sd);
     if (!$this->id) {
         return false;
     }
     $line = getDB()->fetchRow("SELECT * FROM `" . $this->db . "` WHERE id='{$this->id}'");
     if (!$line) {
         $this->id = false;
         return false;
     }
     $this->address = $line['address'];
     $this->port = (int) $line['port'];
     $this->method = (int) $line['method'];
     $this->name = $line['name'];
     $this->slots = (int) $line['slots'];
     $this->info = $line['info'];
     $this->numpl = (int) $line['numpl'];
     $this->online = $line['online'] ? true : false;
     $this->refresh = (int) $line['refresh_time'];
     $this->rcon = !strlen($line['rcon']) ? false : $line['rcon'];
     $this->s_user = !strlen($line['service_user']) ? false : $line['service_user'];
     return true;
 }
开发者ID:qexyorg,项目名称:webMCR-1,代码行数:25,代码来源:monitoring.class.php

示例7: __construct

 public function __construct($variableName, $title, $value = null)
 {
     parent::__construct();
     $this->variableName = $variableName;
     $this->title = $title;
     $this->value = $value;
 }
开发者ID:appshed,项目名称:extension-api,代码行数:7,代码来源:TextArea.php

示例8: __construct

 public function __construct($slug, $nome, $peso, $preco, $rd, $areas, $dp = 0)
 {
     parent::__construct($slug, $nome, $peso, $preco);
     $this->dp = $dp;
     $this->rd = $rd;
     $this->areas = $areas;
 }
开发者ID:landim32,项目名称:gurps-simulator,代码行数:7,代码来源:ArmaduraClass.php

示例9: __construct

 public function __construct($path)
 {
     global $globals;
     parent::__construct($path);
     //if (empty($this->text))
     //    $this->text = $globals->info->home;
 }
开发者ID:ncortot,项目名称:photo-legacy,代码行数:7,代码来源:itemdirectory.php

示例10: __construct

 public function __construct($key, $type, $relatedClass, $foreignKey, $value = null)
 {
     parent::__construct($key, $value);
     $this->type = $type;
     $this->relatedClass = $relatedClass;
     $this->foreignKey = $foreignKey;
 }
开发者ID:skovachev,项目名称:fakefactory,代码行数:7,代码来源:Relation.php

示例11: __construct

 public function __construct($id = false, $style_sd = false)
 {
     global $bd_names, $site_ways, $config;
     parent::__construct($id, ItemType::Skin, $bd_names['sp_skins'], $style_sd);
     $this->base_dir = MCR_ROOT . 'instruments/sp2/skins/';
     $this->base_url = 'instruments/sp2/skins/';
     $this->base_name = 'sp_nc';
     $this->db_likes = $bd_names['likes'];
     $this->db_bad_skins = $bd_names['sp_bad_skins'];
     $this->db_ratio = $bd_names['sp_skins_ratio'];
     if (!$this->id) {
         return false;
     }
     $result = BD("SELECT `name`, `fname`, `fsize`, `dislikes`, `likes`, `ratio`, `gender`, `downloads`, `comments`, `user_id`, `comment_last`  FROM `{$this->db}` WHERE `id`='" . $this->id . "'");
     if (mysql_num_rows($result) != 1) {
         $this->id = false;
         return false;
     }
     $line = mysql_fetch_array($result, MYSQL_NUM);
     $this->name = $line[0];
     $this->fname = $line[1];
     $this->fsize = $line[2];
     $this->dislikes = (int) $line[3];
     $this->likes = (int) $line[4];
     $this->ratio = (int) $line[5];
     $this->gender = (int) $line[6];
     $this->downloads = (int) $line[7];
     $this->comments = (int) $line[8];
     $this->user_id = (int) $line[9];
     $this->comment_last = $line[10] === '0000-00-00 00:00:00' ? false : $line[10];
 }
开发者ID:saneriner,项目名称:webMCR-SkinPoser,代码行数:31,代码来源:skinposer.class.php

示例12: __construct

 public function __construct($meta = 0, $count = 1)
 {
     parent::__construct(self::COOKED_FISH, $meta, $count, "Cooked Fish");
     if ($this->meta === 1) {
         $this->name = "Cooked Salmon";
     }
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:7,代码来源:CookedFish.php

示例13: __construct

 public function __construct($title, $subtitle, $longitude, $latitude)
 {
     parent::__construct();
     $this->title = $title;
     $this->subtitle = $subtitle;
     $this->setPosition($longitude, $latitude);
 }
开发者ID:appshed,项目名称:extension-api,代码行数:7,代码来源:Marker.php

示例14: __construct

 public function __construct($html = null)
 {
     parent::__construct();
     if ($html) {
         $this->html($html);
     }
     return $this;
 }
开发者ID:deadem,项目名称:djem,代码行数:8,代码来源:StaticHtml.php

示例15: __construct

 public function __construct(\Closure $callback = null)
 {
     parent::__construct();
     if (is_callable($callback)) {
         call_user_func($callback, $this);
     }
     return $this;
 }
开发者ID:deadem,项目名称:djem,代码行数:8,代码来源:Editor.php


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