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


PHP Util::normilizeClassName方法代码示例

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


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

示例1: getImplementation

 public function getImplementation($scope)
 {
     if (empty($this->implementationHashMap[$scope])) {
         $normalizedName = Util::normilizeClassName($scope);
         $className = '\\Espo\\Custom\\AclPortal\\' . $normalizedName;
         if (!class_exists($className)) {
             $moduleName = $this->getMetadata()->getScopeModuleName($scope);
             if ($moduleName) {
                 $className = '\\Espo\\Modules\\' . $moduleName . '\\AclPortal\\' . $normalizedName;
             } else {
                 $className = '\\Espo\\AclPortal\\' . $normalizedName;
             }
             if (!class_exists($className)) {
                 $className = '\\Espo\\Core\\AclPortal\\Base';
             }
         }
         if (class_exists($className)) {
             $acl = new $className($scope);
             $dependencies = $acl->getDependencyList();
             foreach ($dependencies as $name) {
                 $acl->inject($name, $this->getContainer()->get($name));
             }
             $this->implementationHashMap[$scope] = $acl;
         } else {
             throw new Error();
         }
     }
     return $this->implementationHashMap[$scope];
 }
开发者ID:houzhenggang,项目名称:espocrm,代码行数:29,代码来源:AclManager.php

示例2: getNotificator

 protected function getNotificator($entityType)
 {
     if (empty($this->notifatorsHash[$entityType])) {
         $normalizedName = Util::normilizeClassName($entityType);
         $className = '\\Espo\\Custom\\Notificators\\' . $normalizedName;
         if (!class_exists($className)) {
             $moduleName = $this->getMetadata()->getScopeModuleName($entityType);
             if ($moduleName) {
                 $className = '\\Espo\\Modules\\' . $moduleName . '\\Notificators\\' . $normalizedName;
             } else {
                 $className = '\\Espo\\Notificators\\' . $normalizedName;
             }
             if (!class_exists($className)) {
                 $className = '\\Espo\\Core\\Notificators\\Base';
             }
         }
         $notificator = new $className();
         $dependencies = $notificator->getDependencyList();
         foreach ($dependencies as $name) {
             $notificator->inject($name, $this->getContainer()->get($name));
         }
         $this->notifatorsHash[$entityType] = $notificator;
     }
     return $this->notifatorsHash[$entityType];
 }
开发者ID:naushrambo,项目名称:espocrm,代码行数:25,代码来源:Notifications.php

示例3: normalizeEntityName

 public function normalizeEntityName($name)
 {
     if (empty($this->entityClassNameHash[$name])) {
         $className = '\\Espo\\Custom\\Entities\\' . Util::normilizeClassName($name);
         if (!class_exists($className)) {
             $className = $this->espoMetadata->getEntityPath($name);
         }
         $this->entityClassNameHash[$name] = $className;
     }
     return $this->entityClassNameHash[$name];
 }
开发者ID:naushrambo,项目名称:espocrm,代码行数:11,代码来源:EntityManager.php

示例4: getClassName

 protected function getClassName($name)
 {
     $name = Util::normilizeClassName($name);
     if (!isset($this->data)) {
         $this->init();
     }
     $name = ucfirst($name);
     if (isset($this->data[$name])) {
         return $this->data[$name];
     }
     return false;
 }
开发者ID:houzhenggang,项目名称:espocrm,代码行数:12,代码来源:EntryPointManager.php

示例5: process

 public function process($controllerName, $actionName, $params, $data, $request)
 {
     $customeClassName = '\\Espo\\Custom\\Controllers\\' . Util::normilizeClassName($controllerName);
     if (class_exists($customeClassName)) {
         $controllerClassName = $customeClassName;
     } else {
         $moduleName = $this->metadata->getScopeModuleName($controllerName);
         if ($moduleName) {
             $controllerClassName = '\\Espo\\Modules\\' . $moduleName . '\\Controllers\\' . Util::normilizeClassName($controllerName);
         } else {
             $controllerClassName = '\\Espo\\Controllers\\' . Util::normilizeClassName($controllerName);
         }
     }
     if ($data && stristr($request->getContentType(), 'application/json')) {
         $data = json_decode($data);
     }
     if ($data instanceof \stdClass) {
         $data = get_object_vars($data);
     }
     if (!class_exists($controllerClassName)) {
         throw new NotFound("Controller '{$controllerName}' is not found");
     }
     $controller = new $controllerClassName($this->container, $request->getMethod());
     if ($actionName == 'index') {
         $actionName = $controllerClassName::$defaultAction;
     }
     $actionNameUcfirst = ucfirst($actionName);
     $beforeMethodName = 'before' . $actionNameUcfirst;
     $actionMethodName = 'action' . $actionNameUcfirst;
     $afterMethodName = 'after' . $actionNameUcfirst;
     $fullActionMethodName = strtolower($request->getMethod()) . ucfirst($actionMethodName);
     if (method_exists($controller, $fullActionMethodName)) {
         $primaryActionMethodName = $fullActionMethodName;
     } else {
         $primaryActionMethodName = $actionMethodName;
     }
     if (!method_exists($controller, $primaryActionMethodName)) {
         throw new NotFound("Action '{$actionName}' (" . $request->getMethod() . ") does not exist in controller '{$controllerName}'");
     }
     if (method_exists($controller, $beforeMethodName)) {
         $controller->{$beforeMethodName}($params, $data, $request);
     }
     $result = $controller->{$primaryActionMethodName}($params, $data, $request);
     if (method_exists($controller, $afterMethodName)) {
         $controller->{$afterMethodName}($params, $data, $request);
     }
     if (is_array($result) || is_bool($result) || $result instanceof \StdClass) {
         return \Espo\Core\Utils\Json::encode($result);
     }
     return $result;
 }
开发者ID:disearth,项目名称:espocrm,代码行数:51,代码来源:ControllerManager.php

示例6: create

 public function create($entityName)
 {
     $className = '\\Espo\\Custom\\SelectManagers\\' . Util::normilizeClassName($entityName);
     if (!class_exists($className)) {
         $moduleName = $this->metadata->getScopeModuleName($entityName);
         if ($moduleName) {
             $className = '\\Espo\\Modules\\' . $moduleName . '\\SelectManagers\\' . Util::normilizeClassName($entityName);
         } else {
             $className = '\\Espo\\SelectManagers\\' . Util::normilizeClassName($entityName);
         }
         if (!class_exists($className)) {
             $className = '\\Espo\\Core\\SelectManagers\\Base';
         }
     }
     $selectManager = new $className($this->entityManager, $this->user, $this->acl, $this->metadata);
     $selectManager->setEntityName($entityName);
     return $selectManager;
 }
开发者ID:jdavis593,项目名称:appitechture,代码行数:18,代码来源:SelectManagerFactory.php

示例7: getRepositoryPath

 public function getRepositoryPath($entityName, $delim = '\\')
 {
     $path = $this->getScopePath($entityName, $delim);
     return implode($delim, array($path, 'Repositories', Util::normilizeClassName(ucfirst($entityName))));
 }
开发者ID:naushrambo,项目名称:espocrm,代码行数:5,代码来源:Metadata.php

示例8: delete

 public function delete($name)
 {
     if (!$this->isCustom($name)) {
         throw new Forbidden();
     }
     $normalizedName = Util::normilizeClassName($name);
     $unsets = array('entityDefs', 'clientDefs', 'scopes');
     $res = $this->getMetadata()->delete('entityDefs', $name);
     $res = $this->getMetadata()->delete('clientDefs', $name);
     $res = $this->getMetadata()->delete('scopes', $name);
     $this->getFileManager()->removeFile("custom/Espo/Custom/Resources/metadata/entityDefs/{$name}.json");
     $this->getFileManager()->removeFile("custom/Espo/Custom/Resources/metadata/clientDefs/{$name}.json");
     $this->getFileManager()->removeFile("custom/Espo/Custom/Resources/metadata/scopes/{$name}.json");
     $this->getFileManager()->removeFile("custom/Espo/Custom/Entities/{$normalizedName}.php");
     $this->getFileManager()->removeFile("custom/Espo/Custom/Services/{$normalizedName}.php");
     $this->getFileManager()->removeFile("custom/Espo/Custom/Controllers/{$normalizedName}.php");
     $this->getFileManager()->removeFile("custom/Espo/Custom/Repositories/{$normalizedName}.php");
     try {
         $this->getLanguage()->delete('Global', 'scopeNames', $name);
         $this->getLanguage()->delete('Global', 'scopeNamesPlural', $name);
     } catch (\Exception $e) {
     }
     $this->getMetadata()->save();
     $this->getLanguage()->save();
     return true;
 }
开发者ID:disearth,项目名称:espocrm,代码行数:26,代码来源:EntityManager.php

示例9: getClassName

 /**
  * Get class name of a job
  *
  * @param  string $name
  * @return string
  */
 protected function getClassName($name)
 {
     $name = Util::normilizeClassName($name);
     $data = $this->getAll();
     $name = ucfirst($name);
     if (isset($data[$name])) {
         return $data[$name];
     }
     return false;
 }
开发者ID:naushrambo,项目名称:espocrm,代码行数:16,代码来源:ScheduledJob.php


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