/** * Prepares a new listified model set up for standard tests * * @param array $data * @return TestModel */ protected function makeNewStandardModel(array $data = []) { $model = parent::makeNewStandardModel($data); if (!array_key_exists('scope', $data)) { $model->scope = 1; } $model->setListifyConfig('scope', '`scope` = 1'); return $model; }
/** * Prepares a new listified model set up for standard tests * * @param array $data * @return TestModel */ protected function makeNewStandardModel(array $data = []) { $model = parent::makeNewStandardModel($data); // make it use the BelongsTo scope and make it belong to a fixed related model if (!array_key_exists('test_related_model_id', $data)) { $model->testRelatedModel()->associate(TestRelatedModel::find(3)); } $model->setListifyConfig('scope', $model->testRelatedModel()); return $model; }
/** * Prepares a new listified model set up for standard tests * * @param array $data * @return TestModel */ protected function makeNewStandardModel(array $data = []) { $model = parent::makeNewStandardModel($data); $model->setListifyConfig('scope', $this->getScopeQueryBuilder()); return $model; }
/** * Prepares a new listified model set up for standard tests * * @param array $data * @return TestModel */ protected function makeNewStandardModel(array $data = []) { $model = parent::makeNewStandardModel($data); // make it use the BelongsTo scope and make it belong to a fixed related model $model->scope = 2; $model->setListifyConfig('scope', $this->getScopeMethodCallable()); return $model; }