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


PHP Project::fill方法代码示例

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


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

示例1: addProject

 public function addProject(array $input)
 {
     $project = new Project();
     $project->fill($input);
     $project->save();
     $this->linkToCurrentUser($project, $input);
     $this->linkToFaculty($project, $input);
     $this->linkToDraftStatus($project, $input);
     return $project;
 }
开发者ID:clubttt,项目名称:SuccessModel4,代码行数:10,代码来源:ResearcherProjectService.php

示例2: store

 public function store(array $input)
 {
     $project = new Project();
     $project->fill($input);
     $project->save();
     $this->linkToFaculty($project, $input);
     $this->linkToStatus($project, $input);
     $this->linkToUser($project, $input);
     return $project;
 }
开发者ID:clubttt,项目名称:SuccessModel4,代码行数:10,代码来源:ProjectService.php

示例3: store

 public function store($request)
 {
     $project = new Project();
     $project->fill($request);
     $project->save();
     /**
      * Membros
      */
     foreach ($request['members'] as $user_id) {
         $user = User::find($user_id);
         $project->members()->save($user);
     }
     /**
      * Categorias
      */
     foreach ($request['categories'] as $category_id) {
         $category = Category::find($category_id);
         $project->categories()->save($category);
     }
     return $project;
 }
开发者ID:ronal2do,项目名称:dave_brubeck,代码行数:21,代码来源:ProjectRepository.php

示例4: postUpdateproject

 public function postUpdateproject(ProjectFormRequest $request)
 {
     $step = $request->get('step');
     $secret_key = $request->get('_secret_key_');
     if (empty($secret_key)) {
         $project = new Project();
         $project->fill($request->except('_token'));
         $project->user_id = $request->input('user_id');
         $project->slug = Str::slug($request->input('name'));
         # Attach file with project
         if ($request->hasFile('file_attachment')) {
             $response = Event::fire(new FileAttachment($request, ['input_file_tag' => 'file_attachment', 'width' => $this->width, 'height' => $this->height, 'mHeight' => $this->mHeight, 'mWidth' => $this->mWidth]));
             if (count($response) > 0) {
                 $project->file_attachment = $response[0];
             }
         }
         # Attach file with project : End
         if ($project->save()) {
             $auto_id = $project->id;
             //$secret_id = Crypt::encrypt($auto_id);
             $request->session()->flash('alert-success', 'Project has been updated successfully');
             $step = $step + 1;
             Session::put('editfstep', $step);
             Session::put('editfs_id', $auto_id);
             return \Redirect::to('/project/projectedit');
         } else {
             Session::put('editfstep', $step);
             $request->session()->flash('alert-warning', 'Error on project creation ! ');
             return redirect()->back()->withInput();
         }
     } else {
         $project_id = $secret_key;
         if ($step == 1) {
             $project = Project::find($project_id);
             $project->fill($request->except('_token'));
             $project->slug = Str::slug($request->input('name'));
             if ($request->hasFile('file_attachment')) {
                 $response = Event::fire(new FileAttachment($request, ['input_file_tag' => 'file_attachment', 'width' => $this->width, 'height' => $this->height, 'mHeight' => $this->mHeight, 'mWidth' => $this->mWidth]));
                 if (count($response) > 0) {
                     $project->file_attachment = $response[0];
                 }
             }
             if ($project->save()) {
                 $request->session()->flash('alert-success', 'Project has been updated successfully');
                 $step = $step + 1;
                 Session::put('editfstep', $step);
                 return \Redirect::to('/project/projectedit');
             }
         }
         if ($step == 2) {
             $projectData = array();
             $projectData['details_description'] = $request->get('details_description');
             $projectData['address'] = $request->get('address');
             $projectData['address_alternate'] = $request->get('address_alternate');
             $projectData['city'] = $request->get('city');
             $projectData['state'] = $request->get('state');
             $projectData['country_id'] = $request->get('country_id');
             $projectData['feed_url'] = $request->get('feed_url');
             $projectData['pincode'] = $request->get('pincode');
             $projectData['external_video_url'] = $request->get('external_video_url');
             //$projectData['media_file_attachment'] = $request->get('media_file_attachment');
             $projectData['media_file_short_note'] = $request->get('media_file_short_note');
             if ($request->hasFile('media_file_attachment')) {
                 $response = Event::fire(new FileAttachment($request, ['input_file_tag' => 'media_file_attachment', 'width' => $this->width, 'height' => $this->height, 'mHeight' => $this->mHeight, 'mWidth' => $this->mWidth]));
                 if (count($response) > 0) {
                     $projectData['media_file_attachment'] = $response[0];
                 }
             }
             if (Project::where('id', $project_id)->update($projectData)) {
                 $request->session()->flash('alert-success', 'Project has been updated successfully');
                 $step = $step + 1;
                 Session::put('editfstep', $step);
                 return \Redirect::to('/project/projectedit');
             } else {
                 Session::put('editfstep', $step);
                 $request->session()->flash('alert-warning', 'Error on project creation ! ');
                 return redirect()->back()->withInput();
             }
         }
         if ($step == 3) {
             $projectData = array();
             //dd( $request->all());
             $reward_row_count = $request->get('reward_row_count');
             $past_row_count = $request->get('past_row_count');
             $pledge_amount = $request->get('pledge_amount');
             $short_note = $request->get('short_note');
             $user_limit = $request->get('user_limit');
             $delevery_year = $request->get('delevery_year');
             $delevery_month = $request->get('delevery_month');
             $shipping_details = $request->get('shipping_details');
             $present_id = $request->get('editid');
             $file = $request->file('file_attachment');
             $startcounter = $past_row_count + 1;
             $endcounter = $reward_row_count - 1;
             if (count($pledge_amount) > 0) {
                 $rewardsData = array();
                 for ($k = 0; $k <= $past_row_count; $k++) {
                     /* $reward = new Reward(); */
                     $rewaedid = $present_id[$k];
                     $reward = Reward::find($rewaedid);
//.........这里部分代码省略.........
开发者ID:udayc,项目名称:travel,代码行数:101,代码来源:ProjectController.php


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