本文整理匯總了PHP中kPluginableEnumsManager::getCoreMap方法的典型用法代碼示例。如果您正苦於以下問題:PHP kPluginableEnumsManager::getCoreMap方法的具體用法?PHP kPluginableEnumsManager::getCoreMap怎麽用?PHP kPluginableEnumsManager::getCoreMap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kPluginableEnumsManager
的用法示例。
在下文中一共展示了kPluginableEnumsManager::getCoreMap方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getFromObjectMap
public function getFromObjectMap()
{
$className = get_class($this);
$cacheKey = kCurrentContext::$ks_hash . '_' . $className;
if (isset(self::$fromObjectMap[$cacheKey])) {
return self::$fromObjectMap[$cacheKey];
}
$reflector = KalturaTypeReflectorCacher::get($className);
if (!$reflector) {
return array();
}
$properties = $reflector->getProperties();
if ($reflector->requiresReadPermission() && !kPermissionManager::getReadPermitted($className, kApiParameterPermissionItem::ALL_VALUES_IDENTIFIER)) {
return array();
// current user has no permission for accessing this object class
}
$result = array();
foreach ($this->getMapBetweenObjects() as $this_prop => $object_prop) {
if (is_numeric($this_prop)) {
$this_prop = $object_prop;
}
if (!isset($properties[$this_prop]) || $properties[$this_prop]->isWriteOnly()) {
continue;
}
// ignore property if it requires a read permission which the current user does not have
if ($properties[$this_prop]->requiresReadPermission() && !kPermissionManager::getReadPermitted($this->getDeclaringClassName($this_prop), $this_prop)) {
KalturaLog::debug("Missing read permission for property {$this_prop}");
continue;
}
$getter_name = "get{$object_prop}";
$getter_params = array();
if (in_array($this_prop, array("createdAt", "updatedAt", "deletedAt"))) {
$getter_params = array(null);
}
$arrayClass = null;
if ($properties[$this_prop]->isArray()) {
$class = $properties[$this_prop]->getType();
if (method_exists($class, 'fromDbArray')) {
$arrayClass = $class;
}
}
$enumMap = null;
if ($properties[$this_prop]->isDynamicEnum()) {
$propertyType = $properties[$this_prop]->getType();
$enumClass = call_user_func(array($propertyType, 'getEnumClass'));
if ($enumClass) {
$enumMap = kPluginableEnumsManager::getCoreMap($enumClass);
}
}
$result[] = array($this_prop, $getter_name, $getter_params, $arrayClass, $enumMap);
}
self::$fromObjectMap[$cacheKey] = $result;
return $result;
}
示例2: isSearchProviderSource
public static function isSearchProviderSource($source)
{
$refClass = new ReflectionClass('EntrySourceType');
$coreConstants = $refClass->getConstants();
if (in_array($source, array_values($coreConstants))) {
return false;
}
$typeMap = kPluginableEnumsManager::getCoreMap('EntrySourceType');
if (isset($typeMap[$source])) {
return false;
}
return true;
}
示例3: getCuePointTypeToClone
/**
* @param entry $entry
* @return array
*/
private static function getCuePointTypeToClone($entry)
{
$listOfEnumIds = array();
$cue_point_plugin_map = kPluginableEnumsManager::getCoreMap('CuePointType');
foreach ($cue_point_plugin_map as $dynamic_enum_id => $plugin_name) {
$plugin = kPluginableEnumsManager::getPlugin($plugin_name);
if ($plugin::shouldCloneByProperty($entry) == true) {
$listOfEnumIds[] = $dynamic_enum_id;
}
}
return $listOfEnumIds;
}