protected function saveAssociation($model, $author) { // record wish/author association $wa = new WishAuthor(); $wa->wish_id = $model->id; $wa->author_id = $author->id; $wa->save(); }
public function removeAuthor($author_id) { $pk = array('wish_id' => $this->id, 'author_id' => $author_id); WishAuthor::model()->deleteByPk($pk); }