Esempio n. 1
0
 /**
  * @test
  */
 public function setNotesSetsNotes()
 {
     $this->fixture->setNotes('Nothing of interest.');
     self::assertEquals('Nothing of interest.', $this->fixture->getNotes());
 }
Esempio n. 2
0
 /**
  * Sets the data of a speaker model based on the data given in $formData.
  *
  * @param tx_seminars_Model_Speaker $speaker
  *        the speaker model to set the data for
  * @param string $prefix the prefix of the form fields in $formData
  * @param array[] $formData the form data to use for setting the speaker data
  *
  * @return void
  */
 private static function setSpeakerData(tx_seminars_Model_Speaker $speaker, $prefix, array $formData)
 {
     /** @var tx_seminars_Mapper_Skill $skillMapper */
     $skillMapper = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_Skill');
     /** @var tx_oelib_List $skills */
     $skills = t3lib_div::makeInstance('tx_oelib_List');
     if (is_array($formData[$prefix . 'skills'])) {
         foreach ($formData[$prefix . 'skills'] as $rawUid) {
             $safeUid = (int) $rawUid;
             if ($safeUid > 0) {
                 /** @var tx_seminars_Model_Skill $skill */
                 $skill = $skillMapper->find($safeUid);
                 $skills->add($skill);
             }
         }
     }
     $speaker->setSkills($skills);
     $speaker->setName(trim(strip_tags($formData[$prefix . 'title'])));
     $speaker->setGender((int) $formData[$prefix . 'gender']);
     $speaker->setOrganization($formData[$prefix . 'organization']);
     $speaker->setHomepage(trim(strip_tags($formData[$prefix . 'homepage'])));
     $speaker->setDescription(trim($formData[$prefix . 'description']));
     $speaker->setNotes(trim(strip_tags($formData[$prefix . 'notes'])));
     $speaker->setAddress(trim(strip_tags($formData[$prefix . 'address'])));
     $speaker->setPhoneWork(trim(strip_tags($formData[$prefix . 'phone_work'])));
     $speaker->setPhoneHome(trim(strip_tags($formData[$prefix . 'phone_home'])));
     $speaker->setPhoneMobile(trim(strip_tags($formData[$prefix . 'phone_mobile'])));
     $speaker->setFax(trim(strip_tags($formData[$prefix . 'fax'])));
     $speaker->setEMailAddress(trim(strip_tags($formData[$prefix . 'email'])));
     $speaker->setCancelationPeriod((int) $formData[$prefix . 'cancelation_period']);
 }