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


PHP Posts::validateReservedAt方法代码示例

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


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

示例1: array

     if (Permission::sufficient('developer')) {
         $reserve_as = Posts::validatePostAs();
         if (isset($reserve_as)) {
             $User = Users::get($reserve_as, 'name');
             if (empty($User)) {
                 Response::fail('User does not exist');
             }
             if (!Permission::sufficient('member', $User->role) && !isset($_POST['screwit'])) {
                 Response::fail('User does not have permission to reserve posts, continue anyway?', array('retry' => true));
             }
             $update['reserved_by'] = $User->id;
         }
     }
     $update['reserved_at'] = date('c');
     if (Permission::sufficient('developer')) {
         $reserved_at = Posts::validateReservedAt();
         if (isset($reserved_at)) {
             $update['reserved_at'] = date('c', $reserved_at);
         }
     }
 }
 if (empty($update) || !$Database->where('id', $Post->id)->update("{$type}s", $update)) {
     Response::fail('Nothing has been changed<br>If you tried to do something, then this is actually an error, which you should <a class="send-feedback">tell us</a> about.');
 }
 if (!empty($overdue)) {
     Logs::action('res_overtake', array_merge(array('id' => $Post->id, 'type' => $type), $overdue));
 }
 if (!empty($update['reserved_by'])) {
     Posts::clearTransferAttempts($Post, $type, 'snatch');
 } else {
     if (!empty($Post->reserved_by)) {
开发者ID:ponydevs,项目名称:MLPVC-RR,代码行数:31,代码来源:post.php


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