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


PHP Functions::get方法代码示例

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


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

示例1: updateCustomer

function updateCustomer($id)
{
    if (is_null($id)) {
        Functions::setResponse(400);
    }
    $data = Functions::getJSONData();
    try {
        $c = new Customer($id);
        $oldnick = $c->get('nickname');
        $oldemail = $c->get('email');
        $passwordUpdate = Functions::get('updatePassword');
        foreach ($c->getFields() as $field) {
            $value = Functions::elt($data, $field['name']);
            if (is_null($value)) {
                Functions::setResponse(400);
            }
            if ($field['name'] != 'password' || !is_null($passwordUpdate)) {
                $c->set($field['name'], $value);
            }
        }
        $c->set('id', $id);
        if (!is_null($passwordUpdate)) {
            $c->set('password', Functions::hash($c->get('password')));
        }
        if (!testUniqueness($c->get('nickname'), $c->get('email'), $oldnick, $oldemail)) {
            Functions::setResponse(409);
        }
        $c->save();
        return true;
    } catch (RuntimeException $e) {
        Functions::setResponse(404);
    }
}
开发者ID:Babaritech,项目名称:babar2,代码行数:33,代码来源:customer.php

示例2: switch

}
/* </functions> */
$action = Functions::get('action');
Functions::checkRights(__FILE__, $action, Functions::get('token'));
switch ($action) {
    case 'fields_info':
        $data = infoFields();
        break;
    case 'new':
        $data = addDrink();
        break;
    case 'update':
        $data = updateDrink(Functions::get('id'));
        break;
    case 'info':
        $data = infoDrink(Functions::get('id'));
        break;
    case 'delete':
        $data = deleteDrink(Functions::get('id'));
        break;
    case 'customer_history':
        $data = getCustomerHistory(Functions::get('id'));
        break;
    case 'list':
        $data = listDrinks();
        break;
    default:
        Functions::setResponse(400);
}
/* </controller> */
loadview('json', $data);
开发者ID:Babaritech,项目名称:babar2,代码行数:31,代码来源:drink.php

示例3: Status

{
    $s = new Status();
    return $s->getFields();
}
/* </functions> */
$action = Functions::get('action');
Functions::checkRights(__FILE__, $action, Functions::get('token'));
switch ($action) {
    case 'fields_info':
        $data = infoFields();
        break;
    case 'new':
        $data = addStatus();
        break;
    case 'update':
        $data = updateStatus(Functions::get('id'));
        break;
    case 'info':
        $data = infoStatus(Functions::get('id'));
        break;
    case 'delete':
        $data = deleteStatus(Functions::get('id'));
        break;
    case 'list':
        $data = listStatuses();
        break;
    default:
        Functions::setResponse(400);
}
/* </controller> */
loadview('json', $data);
开发者ID:Babaritech,项目名称:babar2,代码行数:31,代码来源:status.php

示例4: switch

Functions::checkRights(__FILE__, $action, Functions::get('token'));
switch ($action) {
    case 'fields_info':
        $data = infoFields();
        break;
    case 'new':
        $data = addRight();
        break;
    case 'update':
        $data = updateRight(Functions::get('id'));
        break;
    case 'info':
        $data = infoRight(Functions::get('id'));
        break;
    case 'delete':
        $data = deleteRight(Functions::get('id'));
        break;
    case 'search':
        $data = searchRight(Functions::get('actionId'), Functions::get('statusId'));
        break;
    case 'list':
        $data = listRights();
        break;
    case 'list_easy':
        $data = listRightsEasy();
        break;
    default:
        Functions::setResponse(400);
}
/* </controller> */
loadview('json', $data);
开发者ID:Babaritech,项目名称:babar2,代码行数:31,代码来源:right.php


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