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


PHP PersistableFilter::getSettings方法代码示例

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


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

示例1: testInstantiationAndExecute

 /**
  * @covers PersistableFilter
  */
 public function testInstantiationAndExecute()
 {
     $constructorArg = PersistableFilter::tempGroup('class::lib.pkp.tests.classes.filter.TestClass1', 'class::lib.pkp.tests.classes.filter.TestClass2');
     $testFilter = new PersistableFilter($constructorArg);
     // Test getters/setters that are not implicitly tested by other tests
     self::assertInstanceOf('FilterGroup', $testFilter->getFilterGroup());
     $testFilter->setDisplayName('Some other display name');
     $testFilter->setIsTemplate(1);
     self::assertTrue($testFilter->getIsTemplate());
     self::assertEquals(0, $testFilter->getParentFilterId());
     $testFilter->setParentFilterId(1);
     self::assertEquals(1, $testFilter->getParentFilterId());
     // Test settings
     self::assertFalse($testFilter->hasSettings());
     $testSetting = new EmailFilterSetting('testEmail', 'Test Email', 'Test Email is required');
     $testSetting2 = new EmailFilterSetting('testEmail2', 'Test Email2', 'Test Email2 is required');
     $testSetting2->setIsLocalized(true);
     $testFilter->addSetting($testSetting);
     $testFilter->addSetting($testSetting2);
     self::assertEquals(array('testEmail' => $testSetting, 'testEmail2' => $testSetting2), $testFilter->getSettings());
     self::assertTrue($testFilter->hasSettings());
     self::assertEquals(array('testEmail'), $testFilter->getSettingNames());
     self::assertEquals(array('testEmail2'), $testFilter->getLocalizedSettingNames());
     self::assertTrue($testFilter->hasSetting('testEmail'));
     self::assertEquals($testSetting, $testFilter->getSetting('testEmail'));
     // Test type validation.
     $typeDescriptionFactory = TypeDescriptionFactory::getInstance();
     $inputTypeDescription = 'class::lib.pkp.tests.classes.filter.TestClass1';
     $outputTypeDescription = 'class::lib.pkp.tests.classes.filter.TestClass2';
     self::assertEquals($inputTypeDescription, $testFilter->getInputType()->getTypeDescription());
     self::assertEquals($outputTypeDescription, $testFilter->getOutputType()->getTypeDescription());
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:35,代码来源:PersistableFilterTest.php

示例2: getLocalizedSettingNames

 /**
  * @see PersistableFilter::getLocalizedSettingNames()
  */
 function getLocalizedSettingNames()
 {
     // We cannot use the parent implementation
     // here as this would include all sub-
     // filter settings.
     $localizedSettingNames = array();
     foreach (parent::getSettings() as $setting) {
         if ($setting->getIsLocalized()) {
             $localizedSettingNames[] = $setting->getName();
         }
     }
     return $localizedSettingNames;
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:16,代码来源:CompositeFilter.inc.php


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