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


PHP Parameter::setValue方法代码示例

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


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

示例1: testModify

 function testModify()
 {
     $cal = new Component\VCalendar();
     $param = new Parameter($cal, 'name', null);
     $param->addValue(1);
     $this->assertEquals(array(1), $param->getParts());
     $param->setParts(array(1, 2));
     $this->assertEquals(array(1, 2), $param->getParts());
     $param->addValue(3);
     $this->assertEquals(array(1, 2, 3), $param->getParts());
     $param->setValue(4);
     $param->addValue(5);
     $this->assertEquals(array(4, 5), $param->getParts());
 }
开发者ID:ganeshoph,项目名称:jorani,代码行数:14,代码来源:ParameterTest.php

示例2: manipulate

 /**
  * @see ParameterManipulation::manipulate
  * 
  * @since 0.7
  */
 public function manipulate(Parameter &$parameter, array &$parameters)
 {
     global $egMapsOLLayerGroups, $egMapsOLAvailableLayers;
     $layerDefs = array();
     $layerNames = array();
     foreach ($parameter->getValue() as $layerOrGroup) {
         $lcLayerOrGroup = strtolower($layerOrGroup);
         // Layer groups. Loop over all items and add them when not present yet.
         if (array_key_exists($lcLayerOrGroup, $egMapsOLLayerGroups)) {
             foreach ($egMapsOLLayerGroups[$lcLayerOrGroup] as $layerName) {
                 if (!in_array($layerName, $layerNames)) {
                     if (is_array($egMapsOLAvailableLayers[$layerName])) {
                         $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerName][0];
                     } else {
                         $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerName];
                     }
                     $layerNames[] = $layerName;
                 }
             }
         } elseif (array_key_exists($lcLayerOrGroup, $egMapsOLAvailableLayers)) {
             if (!in_array($lcLayerOrGroup, $layerNames)) {
                 if (is_array($egMapsOLAvailableLayers[$lcLayerOrGroup])) {
                     $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$lcLayerOrGroup][0];
                 } else {
                     $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$lcLayerOrGroup];
                 }
                 $layerNames[] = $lcLayerOrGroup;
             }
         } else {
             $title = Title::newFromText($layerOrGroup, Maps_NS_LAYER);
             if ($title->getNamespace() == Maps_NS_LAYER && $title->exists()) {
                 $layerPage = new MapsLayerPage($title);
                 if ($layerPage->hasValidDefinition('openlayers')) {
                     $layer = $layerPage->getLayer();
                     if (!in_array($layerOrGroup, $layerNames)) {
                         $layerDefs[] = $layer->getJavaScriptDefinition();
                         $layerNames[] = $layerOrGroup;
                     }
                 } else {
                     wfWarn("Invalid layer ({$layerOrGroup}) encountered after validation.");
                 }
             } else {
                 wfWarn("Invalid layer ({$layerOrGroup}) encountered after validation.");
             }
         }
     }
     $parameter->setValue($layerDefs);
     MapsMappingServices::getServiceInstance('openlayers')->addLayerDependencies($this->getDependencies($layerNames));
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:54,代码来源:Maps_ParamOLLayers.php

示例3: manipulate

 /**
  * @see ParameterManipulation::manipulate
  * 
  * @since 0.4
  */
 public function manipulate(Parameter &$parameter, array &$parameters)
 {
     $parameter->setValue($this->wrapper . implode($this->wrapper . $this->delimiter . $this->wrapper, $parameter->getValue()) . $this->wrapper);
 }
开发者ID:yusufchang,项目名称:app,代码行数:9,代码来源:ParamManipulationImplode.php

示例4: testSetAndGetValue

 /**
  * @covers phpDocumentor\Transformer\Template\Parameter::getValue
  * @covers phpDocumentor\Transformer\Template\Parameter::setValue
  */
 public function testSetAndGetValue()
 {
     $this->assertSame(null, $this->fixture->getValue());
     $this->fixture->setValue('value');
     $this->assertSame('value', $this->fixture->getValue());
 }
开发者ID:bbonnesoeur,项目名称:phpDocumentor2,代码行数:10,代码来源:ParameterTest.php

示例5: filterInitializationAlsoRespectsCaseInsensitivity

 /**
  *
  * @test
  */
 public function filterInitializationAlsoRespectsCaseInsensitivity()
 {
     $parameters = array();
     $param = new Parameter();
     $param->setName('typo3version');
     $param->setValue('1.2.3');
     array_push($parameters, $param);
     $this->filter->setParameters($parameters);
     $output = $this->filter->read();
     $this->assertContains('HTTP.userAgent=TYPO3/1.2.3', $output);
 }
开发者ID:dreadlabs,项目名称:typo3-cms-phing-helper,代码行数:15,代码来源:LocalConfigurationFilterTest.php

示例6: manipulate

 /**
  * @see ParameterManipulation::manipulate
  *
  * @since 0.7
  */
 public function manipulate(Parameter &$parameter, array &$parameters)
 {
     global $egMapsOLLayerGroups, $egMapsOLAvailableLayers;
     $layerDefs = array();
     $usedLayers = array();
     foreach ($parameter->getValue() as $layerOrGroup) {
         $lcLayerOrGroup = strtolower($layerOrGroup);
         // Layer groups. Loop over all items and add them if not present yet.
         if (array_key_exists($lcLayerOrGroup, $egMapsOLLayerGroups)) {
             foreach ($egMapsOLLayerGroups[$lcLayerOrGroup] as $layerName) {
                 if (!in_array($layerName, $usedLayers)) {
                     if (is_array($egMapsOLAvailableLayers[$layerName])) {
                         $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerName][0];
                     } else {
                         $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerName];
                     }
                     $usedLayers[] = $layerName;
                 }
             }
         } elseif (array_key_exists($lcLayerOrGroup, $egMapsOLAvailableLayers)) {
             if (!in_array($lcLayerOrGroup, $usedLayers)) {
                 if (is_array($egMapsOLAvailableLayers[$lcLayerOrGroup])) {
                     $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$lcLayerOrGroup][0];
                 } else {
                     $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$lcLayerOrGroup];
                 }
                 $usedLayers[] = $lcLayerOrGroup;
             }
         } else {
             $layerParts = explode($this->groupNameSep, $layerOrGroup, 2);
             $layerGroup = $layerParts[0];
             $layerName = count($layerParts) > 1 ? $layerParts[1] : null;
             $title = Title::newFromText($layerGroup, Maps_NS_LAYER);
             if ($title !== null && $title->getNamespace() == Maps_NS_LAYER) {
                 /**
                  * TODO/FIXME: This shouldn't be here and using $wgParser, instead it should
                  * be somewhere around MapsBaseMap::renderMap. But since we do a lot more than
                  * 'parameter manipulation' in here, we already diminish the information needed
                  * for this which will never arrive there. Perhaps the whole
                  * MapsLayer::getJavaScriptDefinition() shouldn't be done here.
                  */
                 global $wgParser;
                 // add dependency to the layer page so if the layer definition gets updated,
                 // the page where it is used will be updated as well:
                 $rev = Revision::newFromTitle($title);
                 $wgParser->getOutput()->addTemplate($title, $title->getArticleID(), $rev->getId());
                 // if the whole layer group is not yet loaded into the map and the group exists:
                 if (!in_array($layerGroup, $usedLayers) && $title->exists()) {
                     $layerPage = new MapsLayerPage($title);
                     if ($layerName !== null) {
                         // load specific layer with name:
                         $layer = MapsLayers::loadLayer($title, $layerName);
                         $layers = new MapsLayerGroup($layer);
                         $usedLayer = $layerOrGroup;
                     } else {
                         // load all layers from group:
                         $layers = MapsLayers::loadLayerGroup($title);
                         $usedLayer = $layerGroup;
                     }
                     foreach ($layers->getLayers() as $layer) {
                         if (($layer->getName() === null || !in_array($layerGroup . $this->groupNameSep . $layer->getName(), $usedLayers)) && $layer->isOk()) {
                             $layerDefs[] = $layer->getJavaScriptDefinition();
                         }
                     }
                     $usedLayers[] = $usedLayer;
                     // have to add this after loop of course!
                 }
             } else {
                 wfWarn("Invalid layer ({$layerOrGroup}) encountered after validation.");
             }
         }
     }
     $parameter->setValue($layerDefs);
     MapsMappingServices::getServiceInstance('openlayers')->addLayerDependencies($this->getDependencies($usedLayers));
 }
开发者ID:gwdgithubnom,项目名称:Maps,代码行数:80,代码来源:Maps_ParamOLLayers.php


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