public function save($con = null)
 {
     $profile = parent::save($con);
     $values = $this->getValues();
     if (!$values['is_edit_public_flag']) {
         Doctrine_Query::create()->update('MemberProfile')->set('public_flag', $values['default_public_flag'])->where('lft = 1')->andWhere('profile_id = ?', $profile->getId())->execute();
     }
     if ($values['form_type'] === 'date') {
         if (!$profile->getProfileOption()->count()) {
             $dateField = array('year', 'month', 'day');
             foreach ($dateField as $k => $field) {
                 $profileOption = new ProfileOption();
                 $profileOption->setSortOrder($k);
                 $profileOption->setProfile($profile);
                 $profileOption->save();
             }
         }
     }
 }
Example #2
0
 public function save($con = null)
 {
     $profile = parent::save($con);
     $values = $this->getValues();
     if ('date' === $values['form_type']) {
         if (!$profile->getProfileOption()->count()) {
             $dateField = array('year', 'month', 'day');
             foreach ($dateField as $k => $field) {
                 $profileOption = new ProfileOption();
                 $profileOption->setSortOrder($k);
                 $profileOption->setProfile($profile);
                 $profileOption->save();
             }
         }
     }
 }