Ejemplo n.º 1
0
 public function append()
 {
     $mailingList = MailingList::findOne($this->mailing_list_id);
     $partners = Partner::findAll(explode(',', $this->partner_ids));
     foreach ($partners as $partner) {
         $mailingList->unlink('partners', $partner, true);
         $mailingList->link('partners', $partner);
     }
     return true;
 }
Ejemplo n.º 2
0
 /**
  * Finds the MailingList model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return MailingList the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = MailingList::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }