當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。