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


PHP Map::remove方法代码示例

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


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

示例1: 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

示例2: getAllLinesValues

 public function getAllLinesValues()
 {
     $titles = $this->values->get("rowTitles");
     $this->values->remove("rowTitles");
     $valuesToReturn = $this->values->values();
     $this->setTitles($titles);
     return $valuesToReturn;
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:8,代码来源:MapToExcel.php

示例3: testRemovePath

 public function testRemovePath()
 {
     $this->object = new Map();
     $path = Path::factory('/test/description', 'description');
     $path2 = Path::factory('/test/properties/property', 'props')->loop(true, '@inexistant');
     $this->object->add(array($path, $path2));
     $this->assertEquals(2, count($this->object->getPaths()));
     $this->object->remove($path);
     $this->assertEquals(1, count($this->object->getPaths()));
 }
开发者ID:fwk,项目名称:xml,代码行数:10,代码来源:MapTest.php

示例4: 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

示例5: testKeysLocked

 public function testKeysLocked()
 {
     $map = new Map(['foo6' => 'bar6'], true);
     $success = false;
     try {
         $map->set('foo7', 'bar7');
     } catch (\RuntimeException $e) {
         $success = true;
     }
     $this->assertTrue($success);
     $this->assertTrue($map->remove('foo6')->has('foo6'));
     $this->assertEquals('bar6', $map->set('foo6', 'bar6')->get('foo6'));
     $this->assertEquals(['foo6' => null], $map->clear()->toArray());
 }
开发者ID:dtkahl,项目名称:php-array-tools,代码行数:14,代码来源:MapTest.php

示例6: test_remove

 /**
  * @dataProvider provider__construct
  */
 public function test_remove($base, $diff)
 {
     $map = new Map($base);
     foreach ($base as $key => $value) {
         $this->assertEquals($map->get($key), $value);
     }
     foreach ($diff as $key => $value) {
         $map->remove($key);
         unset($base[$key]);
     }
     foreach ($base as $key => $value) {
         $this->assertEquals($map->get($key), $value);
     }
 }
开发者ID:NJIT-CS490-project,项目名称:CS490-backend-api,代码行数:17,代码来源:MapTest.php


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