示例#1
0
 public function getScopeOptions()
 {
     $modelClass = ComponentHelper::instance()->getModelClassDesignTime();
     $result = ['-' => Lang::get('rainlab.builder::lang.components.list_scope_default')];
     try {
         $methods = get_class_methods($modelClass);
         foreach ($methods as $method) {
             if (preg_match('/scope[A-Z].*/', $method)) {
                 $result[$method] = $method;
             }
         }
     } catch (Exception $ex) {
         // Ignore invalid models
     }
     return $result;
 }
 public function getModelKeyColumnOptions()
 {
     return ComponentHelper::instance()->listModelColumnNames();
 }