本文整理汇总了PHP中KServiceInterface::getIdentifier方法的典型用法代码示例。如果您正苦于以下问题:PHP KServiceInterface::getIdentifier方法的具体用法?PHP KServiceInterface::getIdentifier怎么用?PHP KServiceInterface::getIdentifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KServiceInterface
的用法示例。
在下文中一共展示了KServiceInterface::getIdentifier方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIdentifier
/**
* Gets the service identifier.
*
* @return KServiceIdentifier
* @see KObjectServiceable
*/
public final function getIdentifier($identifier = null)
{
if (isset($identifier)) {
$result = $this->__service_container->getIdentifier($identifier);
} else {
$result = $this->__service_identifier;
}
return $result;
}
示例2: getInstance
/**
* Check for overrides of the helper
*
* @param object An optional KConfig object with configuration options
* @param object A KServiceInterface object
* @return ComActivitiesTemplateHelperActivity
*/
public static function getInstance(KConfigInterface $config, KServiceInterface $container)
{
$identifier = clone $config->service_identifier;
$identifier->package = $config->row->package;
$identifier = $container->getIdentifier($identifier);
if (file_exists($identifier->filepath)) {
$classname = $identifier->classname;
} else {
$classname = $config->service_identifier->classname;
}
$instance = new $classname($config);
return $instance;
}
示例3: getInstance
public static function getInstance(KConfigInterface $config, KServiceInterface $container)
{
$identifier = clone $config->service_identifier;
if ($config->data && $config->data->identifier) {
$id = new KServiceIdentifier($config->data->identifier);
if ($id->type === 'com') {
$identifier->package = $id->package;
}
}
$identifier = $container->getIdentifier($identifier);
if ($identifier->classname != 'KDatabaseRowDefault' && class_exists($identifier->classname)) {
$classname = $identifier->classname;
} else {
$classname = 'ComExtmanDatabaseRowExtension';
}
$instance = new $classname($config);
return $instance;
}