本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}