public function _default()
 {
     BreadCrumbs::getInstance()->addCrumb(ucfirst(P))->addCrumb(__('All settings'))->addAction('Add Custom Setting', '?p=' . P . '&do=add');
     $options = new CustomSettingOptionRepository();
     $settings = new CustomSettingRepository();
     $settings->addOrderByField('id');
     $settings->addSimpleSelectFields(['id', 'module', 'key', 'input_type']);
     $settings->addSelectCountFromPairedObject($options, 'options', 'setting_id');
     $table = CmsTable::getInstance()->setHeadingTitle('Custom settings')->addData($settings)->addColumn(ColumnData::getInstance('module')->enableOrderableColumn())->addColumn(ColumnData::getInstance('key')->enableOrderableColumn())->addColumn(ColumnData::getInstance('input_type')->enableOrderableColumn())->addColumn(ColumnData::getInstance('options')->width('1%')->align('right')->href('?p=' . P . '&do=setting_options&id={%id%}')->enableOrderableColumn())->addColumn(ColumnEdit::getInstance('edit')->href('?p=' . P . '&do=edit&id={%id%}')->width('1%')->value(__('Edit')))->addColumn(ColumnDelete::getInstance('delete')->href('?p=' . P . '&do=_delete&id={%id%}'))->setCallbackFunction(function ($data) {
         foreach ($data as &$v) {
             if ($v['input_type'] != 'select') {
                 $v['options'] = ' ';
             }
         }
         return $data;
     });
     echo $table;
 }
 public static function getSettingsPairs($module = NULL)
 {
     $fields = new CustomSettingRepository();
     if ($module) {
         $fields->setWhereModule($module);
     }
     return $fields->getPairs('value', 'key');
 }