Skip to content

Commit

Permalink
Merge pull request #76 from NetCommons3/add_public_method
Browse files Browse the repository at this point in the history
新着データの登録削除を外から呼べるようにした
  • Loading branch information
s-nakajima committed Aug 24, 2016
2 parents 742deda + d1a4732 commit a3d8214
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion Model/Behavior/TopicsBehavior.php
Expand Up @@ -90,6 +90,36 @@ public function setup(Model $model, $config = array()) {
$this->settings[$model->alias]['fields']['is_answer'] = $isAnswer;
}

/**
* saveTopics
*
* @param Model $model 呼び出し元のモデル
* @return void
*/
public function saveTopics(Model $model) {
$this->afterSave($model, false, array('fieldList' => false));
}

/**
* beforeDeleteTopics
*
* @param Model $model 呼び出し元のモデル
* @return void
*/
public function beforeDeleteTopics(Model $model) {
$this->beforeDelete($model, true);
}

/**
* afterDeleteTopics
*
* @param Model $model 呼び出し元のモデル
* @return void
*/
public function afterDeleteTopics(Model $model) {
$this->afterDelete($model);
}

/**
* afterSave is called after a model is saved.
*
Expand Down Expand Up @@ -699,4 +729,4 @@ protected function _saveTopicReadable(Model $model, $topicId) {

return true;
}
}
}

0 comments on commit a3d8214

Please sign in to comment.