/**
  * @author My Vo
  * @name testShouldReturnTableForDigitalModel
  * @todo test should return table for digital model
  *
  * @access public
  */
 public function testShouldReturnTableForDigitalModel()
 {
     //GIVEN
     $expected = 'prj02_table0028';
     // WHEN
     $model = new Prj02DigitalForm();
     // THEN
     $this->assertEquals($expected, $model->getTable());
 }
 /**
  * Handle R4 form, send email for admin and user, insert DB
  *
  * @author My Vo
  * @return view
  */
 public function postDigitalForm(Prj02DigitalForm $prj02DigitalForm, DigitalForm $digitalForm)
 {
     // insert DB
     $prj02DigitalForm->fill($digitalForm->all());
     $prj02DigitalForm->uid = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}")['uid'];
     $prj02DigitalForm->form = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}")['form'];
     if (isset($_SERVER['HTTP_USER_AGENT'])) {
         $prj02DigitalForm->ext1 = $_SERVER['HTTP_USER_AGENT'];
     }
     $prj02DigitalForm->save();
     $arrItem = $prj02DigitalForm->getAttributes();
     // Get subject, URL
     $arrItem['URL'] = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}")['URL'];
     $arrItem['subject'] = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}")['MailSubjectAdmin'];
     $arrItem['CATALOG_ITEM'] = $this->catalogItem;
     // Send mail admin
     \Helper::sendMailAdmin($arrItem, $arrItem['subject']);
     // Send mail user
     $subject = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}")['MailSubjectClient'];
     \Helper::sendMailUser($arrItem, $arrItem['email1'], $subject);
     return redirect()->to(\Config::get('constants.URL_INDEX_DIGITAL'));
 }