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


PHP Factory::getServiceTypeService方法代码示例

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


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

示例1: show_all

function show_all()
{
    //Check the user has permission to see the page, will throw exception
    //if correct permissions are lacking
    checkUserIsAdmin();
    $dn = Get_User_Principle();
    $user = \Factory::getUserService()->getUserByPrinciple($dn);
    $serviceTypes = \Factory::getServiceTypeService()->getServiceTypes();
    $params['ServiceTypes'] = $serviceTypes;
    $params['portalIsReadOnly'] = portalIsReadOnlyAndUserIsNotAdmin($user);
    show_view('admin/view_service_types.php', $params, 'Service Types');
}
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:12,代码来源:view_service_types.php

示例2: deny_delete_type

function deny_delete_type()
{
    //Check the user has permission to see the page, will throw exception
    //if correct permissions are lacking
    checkUserIsAdmin();
    //Get a service type service and then the service type to be deleted
    $serv = \Factory::getServiceTypeService();
    $serviceType = $serv->getServiceType($_REQUEST['id']);
    //Get the services for that service and pass them to the denied view
    $params['ServiceType'] = $serviceType;
    $params['Services'] = $serv->getServices($serviceType->getId());
    //display the deletion denied view
    show_view("admin/delete_service_type_denied.php", $params, 'Deletion Failed');
}
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:14,代码来源:delete_service_type_denied.php

示例3: submit

/**
 * Retrieves the new service type's data from a portal request and submit it to the
 * services layer's service type functions.
 * @return null
 */
function submit()
{
    require_once __DIR__ . '/../../../../htdocs/web_portal/components/Get_User_Principle.php';
    //Get the posted service type data
    $newValues = getSTDataFromWeb();
    //get the user data for the add service type function (so it can check permissions)
    $dn = Get_User_Principle();
    $user = \Factory::getUserService()->getUserByPrinciple($dn);
    try {
        //function will through error if user does not have the correct permissions
        $serviceType = \Factory::getServiceTypeService()->addServiceType($newValues, $user);
        $params = array('Name' => $serviceType->getName(), 'Description' => $serviceType->getDescription(), 'ID' => $serviceType->getId());
        show_view("admin/added_service_type.php", $params, "Successfuly added new service type");
    } catch (Exception $e) {
        show_view('error.php', $e->getMessage());
        die;
    }
}
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:23,代码来源:add_service_type.php

示例4: view_service_type

function view_service_type()
{
    //Check the user has permission to see the page, will throw exception
    //if correct permissions are lacking
    checkUserIsAdmin();
    if (!isset($_REQUEST['id']) || !is_numeric($_REQUEST['id'])) {
        throw new Exception("An id must be specified");
    }
    $dn = Get_User_Principle();
    $user = \Factory::getUserService()->getUserByPrinciple($dn);
    $serv = \Factory::getServiceTypeService();
    $serviceType = $serv->getServiceType($_REQUEST['id']);
    $params['Name'] = $serviceType->getName();
    $params['Description'] = $serviceType->getDescription();
    $params['ID'] = $serviceType->getId();
    $params['Services'] = $serv->getServices($params['ID']);
    $params['portalIsReadOnly'] = portalIsReadOnlyAndUserIsNotAdmin($user);
    show_view("admin/view_service_type.php", $params, $params['Name']);
}
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:19,代码来源:view_service_type.php

示例5: delete_service_type

function delete_service_type()
{
    //The following line will be needed if this controller is ever used for non administrators:
    //checkPortalIsNotReadOnlyOrUserIsAdmin($user);
    if (!isset($_REQUEST['id']) || !is_numeric($_REQUEST['id'])) {
        throw new Exception("An id must be specified");
    }
    //Get the service type from the id
    $serv = \Factory::getServiceTypeService();
    $serviceType = $serv->getServiceType($_REQUEST['id']);
    //keep the name to display later
    $params['Name'] = $serviceType->getName();
    //Delete the service type. This fuction will check the user is allowed to
    //perform this action and throw an error if not.
    $dn = Get_User_Principle();
    $user = \Factory::getUserService()->getUserByPrinciple($dn);
    try {
        $serv->deleteServiceType($serviceType, $user);
    } catch (\Exception $e) {
        show_view('error.php', $e->getMessage());
        die;
    }
    show_view("admin/deleted_service_type.php", $params, $params['Name'] . 'deleted');
}
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:24,代码来源:delete_service_type.php


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