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


PHP Contact::setAttribute方法代码示例

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


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

示例1: store

 public function store(Request $request)
 {
     if (Auth::check()) {
         $staff_id = Auth::user()->id;
         $sfname = Auth::user()->fname;
         $slname = Auth::user()->lname;
     } else {
         return redirect('auth/login');
     }
     $datedoc = Carbon::now(-6);
     $contact = new Contact();
     $contact->fname = $request->input('fname');
     $contact->lname = $request->input('lname');
     $contact->datedoc = $datedoc;
     $contact->sfname = $sfname;
     $contact->sfname = $sfname;
     $contact->slname = $slname;
     $contact->staff_id = $staff_id;
     //  $contact->eie = 0;
     //  $contact->dss = 0;
     //  $contact->client_id = 0;
     //=== this section checks for ids ====
     $inquiry_id = $request->input('inquiry_id');
     $client_id = $request->input('client_id');
     $episode_id = $request->input('episode_id');
     $looper = 0;
     $vals = array($inquiry_id, $client_id, $episode_id);
     $flds = array('inquiry_id', 'client_id', 'episode_id');
     foreach ($flds as $fld) {
         $contact->setAttribute($fld, Input::has($fld) ? $vals[$looper] : '0');
         $looper++;
     }
     //=======================
     $morechks = array('eie', 'dss', 'isprimaryrefsrc', 'isroisigned', 'isrefsrc');
     foreach ($morechks as $morechk) {
         $contact->setAttribute($morechk, Input::has($morechk) ? true : false);
     }
     $contact->contactfname = $request->input('contactfname');
     $contact->contactlname = $request->input('contactlname');
     $contact->phone1 = $request->input('phone1');
     $contact->phone1type = $request->input('phone1type');
     $contact->phone2 = $request->input('phone2');
     $contact->phone2type = $request->input('phone2type');
     $contact->phone3 = $request->input('phone3');
     $contact->phone3type = $request->input('phone3type');
     $contact->reltoclient = $request->input('reltoclient');
     $contact->refsrcreltoclient = $request->input('refsrcreltoclient');
     $contact->address = $request->input('address');
     $contact->city = $request->input('city');
     $contact->usstate = $request->input('usstate');
     $contact->zip = $request->input('zip');
     //  $contact->isrefsrc = $request->input('isrefsrc');
     //  $contact->isprimaryrefsrc = $request->input('isprimaryrefsrc');
     //  $contact->isroisigned = $request->input('isroisigned');
     $contact->save();
     return redirect()->route('inquiryview', $inquiry_id);
 }
开发者ID:jdmays,项目名称:ls1,代码行数:57,代码来源:ContactController.php


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