本文整理匯總了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;
}