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


PHP Map::get方法代码示例

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


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

示例1: selectTypeOf

 /**     
  * @param <type> $key
  * @return Provider
  */
 private function selectTypeOf($key)
 {
     if ($this->types->containsKey($key)) {
         return $this->types->get($key);
     }
     return null;
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:11,代码来源:Classifier.php

示例2: testCopy

 public function testCopy()
 {
     $copy = $this->properties->copy();
     $copy->set('foo5', 'bar5');
     $this->assertEquals('bar5', $copy->get('foo5'));
     $this->assertEquals(null, $this->properties->get('foo5'));
 }
开发者ID:dtkahl,项目名称:php-array-tools,代码行数:7,代码来源:MapTest.php

示例3: search

 /**
  *
  * @param <type> $table
  * @param ArrayIterator $params
  * @return ArrayObject
  */
 public function search($table, ArrayIterator $params)
 {
     $this->searchParams = $params;
     $this->join();
     if ($table == "analysis") {
         $this->statements->remove("type_event");
     }
     $statement = "SELECT this_.* " . $this->selectAttributes() . " FROM {$table} this_ ";
     $statement .= $this->join();
     $i = 0;
     $this->searchParams->rewind();
     if ($this->searchParams->count() > 0 && !$this->searchParams->offsetExists('true')) {
         $statement .= " WHERE ";
     }
     while ($this->searchParams->valid()) {
         if ($this->statements->containsKey($this->searchParams->key())) {
             if ($i++ > 0) {
                 $statement .= " AND ";
             }
             $clause = $this->statements->get($this->searchParams->key());
             $statement .= str_replace(":" . $this->searchParams->key(), "'" . $this->searchParams->current() . "'", $clause['where']);
         }
         $this->searchParams->next();
     }
     return $this->getObject($statement . " ORDER BY this_.date DESC, this_.id DESC");
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:32,代码来源:SearchEngine.php

示例4: generate

 /**
  * Generates a request based on the current apache variables.
  * @throws Exception
  */
 public static function generate()
 {
     $headers = new Map(apache_request_headers());
     $method = $_SERVER['REQUEST_METHOD'];
     $path = $_SERVER['REQUEST_URI'];
     switch ($headers->get('Content-Type', null)) {
         case 'application/json':
             $data = file_get_contents('php://input');
             $values = json_decode($data, true);
             $params = new Map($values);
             break;
         case 'application/x-www-form-urlencoded':
             $params = new Map($_POST);
             break;
         default:
             if ($method === 'GET') {
                 $params = new Map($_GET);
             } else {
                 if ($method === 'POST' || $method === 'PUT') {
                     $params = new Map($_POST);
                 } else {
                     $params = new Map();
                 }
             }
             break;
     }
     return new Request($path, $method, $headers, $params);
 }
开发者ID:NJIT-CS490-project,项目名称:CS490-backend-api,代码行数:32,代码来源:Request.php

示例5: removeAffectsGivenKeyOnly

 /** @test */
 public function removeAffectsGivenKeyOnly()
 {
     $map = new Map(array('foo' => 42, 'bar' => 1337));
     $map->remove('foo');
     $this->assertFalse($map->hasKey('foo'));
     $this->assertEquals(1337, $map->get('bar'));
 }
开发者ID:ulrichsg,项目名称:php-collections,代码行数:8,代码来源:MapTest.php

示例6: recordAccess

 /**
  * Moves the element from current position to end of array
  *
  * @param int|string $key The key
  * @return LRUMap
  */
 protected function recordAccess($key)
 {
     foreach (parent::get($key) as $value) {
         unset($this->elements[$key]);
         $this->elements[$key] = $value;
     }
     return $this;
 }
开发者ID:imunhatep,项目名称:collection,代码行数:14,代码来源:LRUMap.php

示例7: isInstantiable

 private static function isInstantiable(Clazz $clazz, Map $whitelist)
 {
     if ($clazz->isPrimitive()) {
         return true;
     }
     $instantiable = $whitelist->get($clazz);
     return $instantiable != null && $instantiable;
 }
开发者ID:google-code-backups,项目名称:gwtphp-derpc,代码行数:8,代码来源:SerializationPolicy.php

示例8: test_common_and_exotic_keys

 /**
  * @dataProvider provides_keys
  */
 public function test_common_and_exotic_keys($key)
 {
     $map = new Map();
     $map->set($key, 'foo');
     $this->assertSame('foo', $map->get($key, 'baz'));
     $this->assertCount(1, $map);
     $map->all(function ($v, $k) use($key) {
         $this->assertSame($key, $k);
     });
 }
开发者ID:haldayne,项目名称:boost,代码行数:13,代码来源:MapTest.php

示例9: getAllyRelation

 /**
  * Checks an relation to the indicated alliance.
  *
  * @param integer|boolean $aid
  *
  * @return mixed	The relation mode or false
  */
 protected function getAllyRelation($aid = false)
 {
     if (!$aid || !$this->aid) {
         return false;
     }
     $this->loadAllianceRelations();
     if ($this->alliances->size() > 0 && $this->alliances->exists($aid)) {
         return $this->alliances->get($aid);
     }
     return false;
 }
开发者ID:enriquesomolinos,项目名称:Bengine,代码行数:18,代码来源:Relation.php

示例10: getLineWithTitles

 public function getLineWithTitles()
 {
     return new ArrayObject($this->values->get("rowTitles"));
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:4,代码来源:MapToExcel.php

示例11:

<?php

// Runs top to bottom (most important should be at the top)
Map::get('/', 'home#index');
开发者ID:xingcuntian,项目名称:PHP-MVC,代码行数:4,代码来源:routes.php

示例12:

<?php

//Shop Redirect to merchant
Map::get('/', 'home#index');
Map::get('/about-us' . FORMAT, 'staticpage#about');
Map::get('/contact-us' . FORMAT, 'staticpage#contact');
Map::get('/privacy-policy' . FORMAT, 'staticpage#privacy');
Map::get('/brand-index/(.*)', 'brandIndex#index');
Map::get('/cat-by-brand/(.*)', 'brandIndex#catByBrand');
Map::get('/product-by-cat/(.*)', 'brandIndex#productByCategory');
Map::get('/shop', 'shop#index');
Map::get('/shop/categories/(.*)' . FORMAT, 'categories#categories');
Map::get('/shop/brands/(.*)' . FORMAT, 'categories#brands');
Map::get('/shop/category/(.*)' . FORMAT, 'category#category');
Map::get('/shop/brand/(.*)' . FORMAT, 'category#brand');
Map::get('/shop/(.*)', 'product#index');
Map::get('/blog/page/(.*)', 'blog#index');
Map::get('/blog/category/(.*)', 'blog#category');
Map::get('/blog/(.*)', 'blog#article');
Map::get('/search/(.*)', 'search#index');
Map::get('/goto/(.*)', 'goto#index');
Map::get('/error', 'error#index');
Map::get('/(.*)', 'product#index');
开发者ID:phn007,项目名称:MyTools,代码行数:23,代码来源:routes.php

示例13: getFonts

 public function getFonts()
 {
     return $this->map->get($this->id());
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:4,代码来源:Group.php

示例14: filetypeAllowed

 private function filetypeAllowed($filetype)
 {
     return $this->filetypeAllowed->get($filetype);
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:4,代码来源:PublicationController.php

示例15: getMap

 /**
  * Get the map where the match was played on
  * @return Map Returns an invalid map if no map was found
  */
 public function getMap()
 {
     return Map::get($this->map);
 }
开发者ID:allejo,项目名称:bzion,代码行数:8,代码来源:Match.php


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