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


PHP Invitation::find方法代码示例

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


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

示例1: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $invitation = Invitation::find($id);
     if (!is_null($invitation)) {
         if ($invitation->delete()) {
             return Redirect::route('admin.invitations.index')->withErrors(array('mainSuccess' => 'Поканата е успешно изтрита.'));
         } else {
             return Redirect::route('admin.invitations.index')->withErrors(array('mainError' => 'Грешка с базата данни.'));
         }
     } else {
         return Redirect::route('admin.invitations.index')->withErrors(array('mainError' => 'Поканата не е намерена.'));
     }
 }
开发者ID:mertindervish,项目名称:registerbg,代码行数:19,代码来源:AdminInvitationController.php

示例2: emailChanged

 function emailChanged()
 {
     $invites = new Invitation();
     $invites->address = $this->email;
     $invites->address_type = 'email';
     if ($invites->find()) {
         while ($invites->fetch()) {
             $other = User::staticGet($invites->user_id);
             subs_subscribe_to($other, $this);
         }
     }
 }
开发者ID:stevertiqo,项目名称:StatusNet,代码行数:12,代码来源:User.php

示例3: emailChanged

 function emailChanged()
 {
     $invites = new Invitation();
     $invites->address = $this->email;
     $invites->address_type = 'email';
     if ($invites->find()) {
         while ($invites->fetch()) {
             try {
                 $other = Profile::getKV('id', $invites->user_id);
                 if (!$other instanceof Profile) {
                     // remove when getKV throws exceptions
                     continue;
                 }
                 Subscription::start($other, $this->getProfile());
             } catch (Exception $e) {
                 continue;
             }
         }
     }
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:20,代码来源:User.php

示例4: bindEvent

 public function bindEvent($user)
 {
     $this->loadModel('Invitation');
     $invitation = new Invitation();
     $conditions = ['Invitation.email' => $user['username']];
     $result = $invitation->find('first', compact('conditions'));
     if (!empty($result)) {
         $this->loadModel('UserEvent');
         $this->loadModel('UserEventShare');
         $userEvent = new UserEvent();
         $userEventShare = new UserEventShare();
         $event = $result['UserEvent'];
         $invitation = $result['Invitation'];
         $ueShare = array('user_id' => $user['id'], 'user_event_id' => $invitation['object_id']);
         $event['recipient_id'] = $user['id'];
         $userEvent->create();
         $userEvent->set($event);
         $userEvent->save();
         $userEventShare->create();
         $userEventShare->set($ueShare);
         $userEventShare->save();
     }
 }
开发者ID:nilBora,项目名称:konstruktor,代码行数:23,代码来源:User.php

示例5: declineInvite

 /**
  * @api {delete} /invitations/:id/users/:idUser/decline Decline group invitation
  * @apiName Decline group invitation
  * @apiGroup Invitation
  * @apiHeader (Header) {String} X_Authorization Authorization value.
  * @apiParam  (url Parameter) {Number} id Invitation unique ID.
  * @apiParam  (url Parameter) {Number} idUser Users unique ID.
  * 
  * @apiError 404 Not found. This will happen if the role id/user id/group id is not in our system.
  * @apiError 401 Not authorized. This will happen if the header value is not attached.
  * @apiError 409 The link expired.  
  */
 public static function declineInvite($id, $idUser)
 {
     $app = \Slim\Slim::getInstance();
     $invitation = Invitation::find($id);
     if (!$invitation) {
         $app->halt('404');
     }
     if ($invitation->receiver_id != $idUser) {
         $app->halt('401');
     }
     if ($invitation->group_jointed_at) {
         $app->halt('409', json_encode('expired'));
     }
     //self::attachUser($invitation->group_id,$invitation->receiver_id);
     $invitation->delete();
 }
开发者ID:aanyun,项目名称:PHP-Sample-Code,代码行数:28,代码来源:GroupController.php


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