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


PHP Club::save方法代码示例

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


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

示例1: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Club();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Club'])) {
         $model->attributes = $_POST['Club'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->clubId));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:first-lab,项目名称:tebing,代码行数:17,代码来源:ClubController.php

示例2: store

 /**
 * Store a newly created resource in storage.
 * POST /administratorclub
 *
 * @return Response
 */
 public function store()
 {
     $uuid = Uuid::generate();
     $validator = Validator::make(Input::all(), AdministratorClub::$rules);
     if ($validator->passes()) {
         $repo = App::make('UserRepository');
         $user = $repo->signup(Input::all());
         $role = Role::find(2);
         $user->attachRole($role);
         if ($user->id) {
             $profile = new Profile();
             $profile->user_id = $user->id;
             $profile->firstname = Input::get('firstname');
             $profile->lastname = Input::get('lastname');
             $profile->mobile = Input::get('mobile');
             $profile->avatar = '/img/coach-avatar.jpg';
             $profile->save();
             $club = new Club();
             $club->id = $uuid;
             $club->name = Input::get('name');
             $club->sport = 'lacrosse';
             $club->phone = Input::get('contactphone');
             $club->website = Input::get('website');
             $club->email = Input::get('contactemail');
             $club->add1 = Input::get('add1');
             $club->city = Input::get('city');
             $club->state = Input::get('state');
             $club->zip = Input::get('zip');
             $club->logo = Input::get('logo');
             $club->waiver = Input::get('waiver');
             $club->processor_user = Crypt::encrypt(Input::get('processor_user'));
             $club->processor_pass = Crypt::encrypt(Input::get('processor_pass'));
             $club->save();
             $clubs = Club::find($uuid);
             $clubs->users()->save($user);
             if (Config::get('confide::signup_email')) {
                 Mail::queueOn(Config::get('confide::email_queue'), Config::get('confide::email_account_confirmation'), compact('user'), function ($message) use($user) {
                     $message->to($user->email, $user->username)->subject(Lang::get('confide::confide.email.account_confirmation.subject'));
                 });
             }
             return Redirect::action('UsersController@login')->with('notice', Lang::get('confide::confide.alerts.account_created'));
         } else {
             $error = $user->errors()->all(':message');
             return Redirect::back()->withInput(Input::except('password'))->withErrors($error);
         }
     }
     return Redirect::back()->withErrors($validator)->withInput();
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:54,代码来源:AdministratorClubController.php

示例3: convertClub

 /**
  * 
  * @param stdClass $club
  * return Club
  */
 protected function convertClub(stdClass $club)
 {
     $oClub = Club::getByNefubId($club->ID);
     if (!$oClub) {
         $oClub = new Club();
         $oClub->nefub_id = $club->ID;
         $oClub->name = $club->Name;
         $oClub->city = $club->Place;
         if ($club->Website) {
             $oClub->website = 'http://' . str_replace('http://', '', $club->Website);
         }
         $oClub->email = $club->Email;
         $oClub->save();
     }
     return $oClub;
 }
开发者ID:rjpijpker,项目名称:nefub-mobile,代码行数:21,代码来源:APIRetriever.php

示例4: Club

     if (isset($_POST['nom']) && isset($_POST['localisation'])) {
         $club = new Club();
         $club->setNom($_POST['nom']);
         $club->setLocalisation($_POST['localisation']);
         $club->save();
         header('Location: ' . $config['url'] . "/" . basename(__FILE__));
     }
     render("clubs/ajouter", array());
     break;
 case "editer":
     if (isset($_POST['nom']) && isset($_POST['localisation']) && isset($_POST['id'])) {
         $club = new Club();
         $club->setId($_POST['id']);
         $club->setNom($_POST['nom']);
         $club->setLocalisation($_POST['localisation']);
         $club->save();
         header('Location: ' . $config['url'] . "/" . basename(__FILE__));
     }
     if (isset($_GET['id'])) {
         $club_id = intval($_GET['id']);
         render("clubs/editer", array('club' => $cr->findById($club_id)));
     } else {
         header('Location: ' . $config['url'] . "/" . basename(__FILE__));
     }
     break;
 case "supprimer":
     if (isset($_GET['id'])) {
         $club_id = intval($_GET['id']);
         $club = new Club();
         $club->setId($club_id);
         $club->delete();
开发者ID:gdouezangrard,项目名称:basketball-matches,代码行数:31,代码来源:clubs.php

示例5: saveClubInfo

 private function saveClubInfo($user)
 {
     $title = Input::get('club_title', '');
     $brief = Input::get('club_brief', '');
     $img_token = Input::get('img_token_2', '');
     if ($title) {
         $club = Club::where('u_id', '=', $user->u_id)->first();
         if (empty($club)) {
             $club = new Club();
             $club->u_id = $user->u_id;
             $club->s_id = $user->u_school_id;
             $club->c_title = $title;
             $club->addClub();
         }
         $club->c_title = $title;
         $club->c_brief = $brief;
         $c_id = $club->c_id;
         $imgObj = new Img('club', $img_token);
         $club->c_imgs = $imgObj->getSavedImg($c_id, $club->c_imgs);
         $club->save();
     }
     return true;
 }
开发者ID:qnck,项目名称:qingnianchuangke,代码行数:23,代码来源:MeProfileController.php


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