Example #1
0
 public function __construct($meta = 0, $count = 1)
 {
     parent::__construct(self::COAL, $meta, $count, "Coal");
     if ($this->meta === 1) {
         $this->name = "Charcoal";
     }
 }
Example #2
0
 public function __construct($variableName, $type, $title)
 {
     parent::__construct();
     $this->variableName = $variableName;
     $this->type = $type;
     $this->title = $title;
 }
 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'];
 }
Example #4
0
 public function __construct($name, array $data)
 {
     parent::__construct($name, $data);
     foreach ($data['values'] as $value) {
         $this->values[] = new AspectValue($value['name'], $value);
     }
 }
Example #5
0
 /**
  * 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');
     }
 }
Example #6
0
 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;
 }
Example #7
0
 public function __construct($variableName, $title, $value = null)
 {
     parent::__construct();
     $this->variableName = $variableName;
     $this->title = $title;
     $this->value = $value;
 }
 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;
 }
Example #9
0
 public function __construct($path)
 {
     global $globals;
     parent::__construct($path);
     //if (empty($this->text))
     //    $this->text = $globals->info->home;
 }
Example #10
0
 public function __construct($key, $type, $relatedClass, $foreignKey, $value = null)
 {
     parent::__construct($key, $value);
     $this->type = $type;
     $this->relatedClass = $relatedClass;
     $this->foreignKey = $foreignKey;
 }
 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];
 }
Example #12
0
 public function __construct($meta = 0, $count = 1)
 {
     parent::__construct(self::COOKED_FISH, $meta, $count, "Cooked Fish");
     if ($this->meta === 1) {
         $this->name = "Cooked Salmon";
     }
 }
Example #13
0
 public function __construct($title, $subtitle, $longitude, $latitude)
 {
     parent::__construct();
     $this->title = $title;
     $this->subtitle = $subtitle;
     $this->setPosition($longitude, $latitude);
 }
Example #14
0
 public function __construct($html = null)
 {
     parent::__construct();
     if ($html) {
         $this->html($html);
     }
     return $this;
 }
Example #15
0
 public function __construct(\Closure $callback = null)
 {
     parent::__construct();
     if (is_callable($callback)) {
         call_user_func($callback, $this);
     }
     return $this;
 }
Example #16
0
 public function __construct($variableName, $title, $value = '1', $checked = false)
 {
     parent::__construct();
     $this->variableName = $variableName;
     $this->title = $title;
     $this->value = $value;
     $this->checked = $checked;
 }
Example #17
0
 public function __construct($label, $url, $isSelected = false, $fieldName = '', $matchCount = 0, $clusterLevel = 0, $previewImage = '')
 {
     parent::__construct($label, $url, $isSelected);
     $this->fieldName = (string) $fieldName;
     $this->matchCount = (int) $matchCount;
     $this->clusterLevel = (int) $clusterLevel;
     $this->previewImage = (string) $previewImage;
 }
 /**
  * @param string $query The query's name - will be used as the item's label.
  * @param string $url
  * @param int $hitCount Indicates how many products this suggestions will
  *        lead to.
  * @param string $type Simple string which describes where this suggest
  *        query comes from (e.g. product name, category, log file).
  * @param string $imageUrl
  * @param array $attributes Additional return data fields
  */
 public function __construct($query, $url, $hitCount = 0, $type = '', $imageUrl = '', array $attributes = array())
 {
     // Suggestions are never pre-selected.
     parent::__construct($query, $url, false);
     $this->hitCount = (int) $hitCount;
     $this->type = (string) $type;
     $this->imageUrl = (string) $imageUrl;
     $this->attributes = $attributes;
 }
Example #19
0
 public function __construct($variableName, $type, $title, $subtitle = null)
 {
     parent::__construct();
     $this->variableName = $variableName;
     $this->title = $title;
     $this->subtitle = $subtitle;
     $this->type = $type;
     $this->post = true;
 }
Example #20
0
 public function __construct($text = null)
 {
     parent::__construct();
     $this->xtype('label');
     if ($text) {
         $this->text($text);
     }
     return $this;
 }
Example #21
0
 public function __construct($path)
 {
     global $globals;
     parent::__construct($path);
     $this->small_path = $globals->path->small . '/' . $this->hash() . '.jpg';
     $this->medium_path = $globals->path->medium . '/' . $this->hash() . '.jpg';
     $ext = strrchr($this->name, '.');
     if ($ext !== false) {
         $this->text = substr($this->name, 0, -strlen($ext));
     }
 }
Example #22
0
 public function __construct($meta = 0, $count = 1)
 {
     parent::__construct(self::RAW_FISH, $meta, $count, "Raw Fish");
     if ($meta === 1) {
         $this->name = "Raw Salmon";
     } elseif ($meta === 2) {
         $this->name = "Clownfish";
     } elseif ($meta === 3) {
         $this->name = "Pufferfish";
     }
 }
Example #23
0
 public function __construct(array $data)
 {
     parent::__construct($data);
     foreach ($this->tags as $tag) {
         if (strtolower($tag['category']) == 'rarity') {
             $this->rarity = strtolower($tag['name']);
         } elseif (strtolower($tag['category']) == 'hero') {
             $this->characters[] = $tag['name'];
         } elseif (strtolower($tag['category']) == 'quality') {
             $this->quality = $tag['name'];
         }
     }
 }
Example #24
0
 function __construct($params)
 {
     parent::__construct();
     $this->_get = $params;
     $this->getDBParams();
     //print_r($this->_get);
     //print_r($this->order_by);
     $this->result = ItemResource::newInstance()->getResources(Params::getParam('resourceId'), $this->_get['iDisplayStart'], $this->_get['iDisplayLength'], isset($this->order_by['column_name']) ? $this->order_by['column_name'] : 'pk_i_id', isset($this->order_by['type']) ? $this->order_by['type'] : 'desc');
     $this->filtered_total = ItemResource::newInstance()->countResources(Params::getParam('resourceId'));
     $this->total = ItemResource::newInstance()->countResources('');
     $this->toDatatablesFormat();
     $this->dumpToDatatables();
 }
Example #25
0
 public function __construct($path)
 {
     $path = (string) $path;
     $realpath = realpath($path);
     if (!$path || !$realpath) {
         throw new LogicException('The path "' . $path . '" must be a valid directory.');
     }
     try {
         parent::__construct($realpath);
     } catch (RuntimeException $e) {
         throw new RuntimeException("Could not open directory {$path} with message: {$e->getMessage()}.");
     }
 }
Example #26
0
 public function __construct($meta = 0, $count = 1)
 {
     parent::__construct(self::HEAD, $meta, $count, "Skeleton Skull");
     if ($this->meta === 1) {
         $this->name = "Wither Skeleton Skull";
     } elseif ($this->meta === 2) {
         $this->name = "Zombie Head";
     } elseif ($this->meta === 3) {
         $this->name = "Head";
     } elseif ($this->meta === 4) {
         $this->name = "Creeper Head";
     }
 }
Example #27
0
 public function __construct($label, $link, $icon = null)
 {
     parent::__construct($label, $icon);
     $this->linkParameters = array();
     if (is_array($link)) {
         if (count($link) < 2) {
             throw new \Firenote\Exception('Menu link route is not valid');
         }
         $this->link = $link[0];
         $this->linkParameters = $link[1];
     } else {
         $this->link = $link;
     }
 }
Example #28
0
 public function __construct($meta = 0, $count = 1)
 {
     parent::__construct(self::BOAT, $meta, $count, "Oak Boat");
     if ($this->meta === 1) {
         $this->name = "Spruce Boat";
     } elseif ($this->meta === 2) {
         $this->name = "Birch Boat";
     } elseif ($this->meta === 3) {
         $this->name = "Jungle Boat";
     } elseif ($this->meta === 4) {
         $this->name = "Acacia Boat";
     } elseif ($this->meta === 5) {
         $this->name = "Dark Oak Boat";
     }
 }
Example #29
0
 public function __construct($game)
 {
     parent::__construct($game);
     $cardRepository = new CardRepository(TRUE);
     $drawPile = unserialize($game['draw_pile']);
     $drawPileCards = array();
     if ($drawPile) {
         foreach ($drawPile as $cardId) {
             $drawPileCards[] = $cardRepository->getOneById($cardId);
         }
     }
     $this->setAdditionalField('draw_pile', $drawPileCards);
     $throwPile = unserialize($game['throw_pile']);
     $throwPileCards = array();
     if ($throwPile) {
         foreach ($throwPile as $cardId) {
             $throwPileCards[] = $cardRepository->getOneById(intval($cardId));
         }
     }
     $this->setAdditionalField('throw_pile', $throwPileCards);
     $playerRepository = new PlayerRepository();
     $players = $playerRepository->getByGame($game['id']);
     $this->setAdditionalField('players', $players);
     $this->setAdditionalField('matrix', unserialize($game['distance_matrix']));
     $gameSets = unserialize($game['game_sets']);
     if (in_array(3, $gameSets)) {
         $isHighNoon = TRUE;
     } else {
         $isHighNoon = FALSE;
     }
     $this->setAdditionalField('isHighNoon', $isHighNoon);
     if ($isHighNoon) {
         $highNoonPile = unserialize($game['high_noon_pile']);
         $highNoonRepository = new HighNoonRepository(TRUE);
         $highNoonPileCards = array();
         if ($highNoonPile) {
             foreach ($highNoonPile as $cardId) {
                 $highNoonPileCards[] = $highNoonRepository->getOneById(intval($cardId));
             }
         }
         $this->setAdditionalField('highNoonPile', $highNoonPileCards);
         if ($game['high_noon']) {
             $highNoonRepository = new HighNoonRepository();
             $highNoon = $highNoonRepository->getOneById(intval($game['high_noon']));
             $this->setAdditionalField('highNoon', $highNoon);
         }
     }
 }
Example #30
0
 function __construct($params)
 {
     parent::__construct();
     $this->_get = $params;
     $this->getDBParams();
     if ($this->stat) {
         $list_items = $this->findByItemStat($this->stat);
     } else {
         $list_items = $this->list_items(Params::getParam('catId') == '' ? null : Params::getParam('catId'), $this->start, $this->limit, null, $this->order_by, $this->search);
     }
     $this->result = $list_items['items'];
     $this->filtered_total = $list_items['found'];
     $this->total = $this->total_items();
     $this->toDatatablesFormat();
     $this->dumpToDatatables();
 }