'bool'
];
protected $fillable = [
'i_q_content_category_id',
'question',
'question_text',
'answer',
'answer_text',
'active'
];
public function iq_content_category()
{
return $this->belongsTo(IQContentCategory::class, 'i_q_content_category_id');
}
public function iq_content_faq()
{
return $this->hasMany(IQContentFaq::class, 'faq_id', 'id');
}
public static function getSiteOptions($id, $identifier, $html = true, $choose = true) {
$values = [];
$ret = "";
$models = AnswerQuestion::with('iq_content_category')->select('answer_questions.*')->where('answer_questions.active', 1)//->where('iq_content_category.identifier', $identifier)
->whereHas('iq_content_category', function ($q) use ($identifier) {
$q->where('slug', 'reisefuehrer');
})->get();
if($html) {
if($choose){
$ret .= '\n';
}
foreach ($models as $model) {
$attr = ($model->id == $id) ? ' selected="selected"' : '';
$ret .= '\n';
}
return $ret;
}else{
foreach ($models as $model) {
$values[$model->id] = $model->question;
}
return $values;
}
return false;
}
}