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


PHP Extension::get_classname_without_arguments方法代码示例

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


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

示例1: get_extensions

	/**
	 * @param string $class
	 * @param bool $includeArgumentString Include the argument string in the return array,
	 *  FALSE would return array("Versioned"), TRUE returns array("Versioned('Stage','Live')").
	 * @return array Numeric array of either {@link DataExtension} classnames,
	 *  or eval'ed classname strings with constructor arguments.
	 */
	public static function get_extensions($class, $includeArgumentString = false) {
		$extensions = Config::inst()->get($class, 'extensions');

		if($includeArgumentString) {
			return $extensions;
		} else {
			$extensionClassnames = array();
			if($extensions) foreach($extensions as $extension) {
				$extensionClassnames[] = Extension::get_classname_without_arguments($extension);
			}
			return $extensionClassnames;
		}
	}
开发者ID:redema,项目名称:sapphire,代码行数:20,代码来源:Object.php

示例2: get_extensions

 /**
  * @param string $class
  * @param bool $includeArgumentString Include the argument string in the return array,
  *  FALSE would return array("Versioned"), TRUE returns array("Versioned('Stage','Live')").
  * @return array Numeric array of either {@link DataObjectDecorator} classnames,
  *  or eval'ed classname strings with constructor arguments.
  */
 function get_extensions($class, $includeArgumentString = false)
 {
     $extensions = self::get_static($class, 'extensions');
     if ($includeArgumentString) {
         return $extensions;
     } else {
         $extensionClassnames = array();
         if ($extensions) {
             foreach ($extensions as $extension) {
                 $extensionClassnames[] = Extension::get_classname_without_arguments($extension);
             }
         }
         return $extensionClassnames;
     }
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:22,代码来源:Object.php

示例3: get_extensions

 /**
  * @param string $class
  * @param bool $includeArgumentString Include the argument string in the return array,
  *  FALSE would return array("Versioned"), TRUE returns array("Versioned('Stage','Live')").
  * @return array Numeric array of either {@link DataExtension} classnames,
  *  or eval'ed classname strings with constructor arguments.
  */
 public static function get_extensions($class, $includeArgumentString = false)
 {
     $extensions = Config::inst()->get($class, 'extensions');
     if (empty($extensions)) {
         return array();
     }
     // Clean nullified named extensions
     $extensions = array_filter(array_values($extensions));
     if ($includeArgumentString) {
         return $extensions;
     } else {
         $extensionClassnames = array();
         if ($extensions) {
             foreach ($extensions as $extension) {
                 $extensionClassnames[] = Extension::get_classname_without_arguments($extension);
             }
         }
         return $extensionClassnames;
     }
 }
开发者ID:guttmann,项目名称:silverstripe-framework,代码行数:27,代码来源:Object.php

示例4: has_extension

 /**
  * Return TRUE if a class has a specified extension.
  * This supports backwards-compatible format (static Object::has_extension($requiredExtension))
  * and new format ($object->has_extension($class, $requiredExtension))
  * @param string $classOrExtension if 1 argument supplied, the class name of the extension to
  *								 check for; if 2 supplied, the class name to test
  * @param string $requiredExtension used only if 2 arguments supplied
  * @param boolean $strict if the extension has to match the required extension and not be a subclass
  * @return bool Flag if the extension exists
  */
 public static function has_extension($classOrExtension, $requiredExtension = null, $strict = false)
 {
     //BC support
     if (func_num_args() > 1) {
         $class = $classOrExtension;
     } else {
         $class = get_called_class();
         $requiredExtension = $classOrExtension;
     }
     $requiredExtension = Extension::get_classname_without_arguments($requiredExtension);
     $extensions = self::get_extensions($class);
     foreach ($extensions as $extension) {
         if (strcasecmp($extension, $requiredExtension) === 0) {
             return true;
         }
         if (!$strict && is_subclass_of($extension, $requiredExtension)) {
             return true;
         }
     }
     return false;
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:31,代码来源:Extensible.php

示例5: getDirectExtensions

 /**
  * Gets all extensions directly on this class that extend FluentExtension
  *
  * @param Config $config
  * @param string $class
  * @return array
  */
 protected function getDirectExtensions($config, $class)
 {
     $extensions = $config->get($class, 'extensions', Config::UNINHERITED);
     $found = array();
     if ($extensions) {
         foreach ($extensions as $extension) {
             $extensionClass = ClassInfo::class_name(Extension::get_classname_without_arguments($extension));
             if ($extensionClass === 'FluentExtension' || is_subclass_of($extensionClass, 'FluentExtension')) {
                 $found[] = $extensionClass;
             }
         }
     }
     return $found;
 }
开发者ID:tractorcow,项目名称:silverstripe-fluent,代码行数:21,代码来源:FluentValidateTask.php


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