make SqlPara use the model with attr datas.
@param model
@columns fetch columns
433777
public static SqlPara selectOne(ModelExt<?> model, String... columns) {
		return SqlpKit.select(model, FLAG.ONE, columns);
	}
1309252
protected function prepareDataProvider($model)
    {
        $dataProvider = parent::prepareDataProvider($model);
        /** @var \yii\db\ActiveQuery $query */
        $query = $dataProvider->query;

        // lazy load related models to mark checkboxes
        $relation = Yii::$app->request->getQueryParam('relation');
        if (!empty($relation)) {
            $query->with($relation);
        }

        return $dataProvider;
    }
700442
protected function setColumns($model)
    {
        $schema = $model->getConnection()->getDoctrineSchemaManager();
        $platform = $schema->getDatabasePlatform();

        // Prevents a DBALException if the table contains an enum.
        $platform->registerDoctrineTypeMapping('enum', 'string');

        list($table, $database) = $this->getTableAndDatabase($model);

        $this->columns = $model->getConnection()->getDoctrineConnection()->fetchAll(
            $platform->getListTableColumnsSQL($table, $database)
        );

        $this->rejectVirtualColumns();

        $columns = $this->columns;
        $this->columns = call_user_func(\Closure::bind(function () use ($table, $database, $columns) {
            return $this->_getPortableTableColumnList($table, $database, $columns);
        }, $schema, $schema));

        return $this->unquoteColumnNames($platform->getIdentifierQuoteCharacter());
    }
1213491
public function getColumnsNames(array $columns, $model = null): array
    {
        return array_map(function ($column) use ($model) {
            return $this->getColumnName($column, $model);
        }, $columns);
    }
533961
protected Map<String, Object> getModelAttributes(final Map<String, Object> model) {
        return (Map<String, Object>) model.get(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_ATTRIBUTES);
    }
1367823
protected function getPropertiesFromTable($model)
    {
        $table = $model->getConnection()->getTablePrefix() . $model->getTable();
        $schema = $model->getConnection()->getDoctrineSchemaManager($table);
        $databasePlatform = $schema->getDatabasePlatform();
        $databasePlatform->registerDoctrineTypeMapping('enum', 'string');

        $platformName = $databasePlatform->getName();
        $customTypes = $this->laravel['config']->get("ide-helper.custom_db_types.{$platformName}", array());
        foreach ($customTypes as $yourTypeName => $doctrineTypeName) {
            $databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName);
        }

        $database = null;
        if (strpos($table, '.')) {
            list($database, $table) = explode('.', $table);
        }

        $columns = $schema->listTableColumns($table, $database);

        if ($columns) {
            foreach ($columns as $column) {
                $name = $column->getName();
                if (in_array($name, $model->getDates())) {
                    $type = '\Illuminate\Support\Carbon';
                } else {
                    $type = $column->getType()->getName();
                    switch ($type) {
                        case 'string':
                        case 'text':
                        case 'date':
                        case 'time':
                        case 'guid':
                        case 'datetimetz':
                        case 'datetime':
                            $type = 'string';
                            break;
                        case 'integer':
                        case 'bigint':
                        case 'smallint':
                            $type = 'integer';
                            break;
                        case 'boolean':
                            switch (config('database.default')) {
                                case 'sqlite':
                                case 'mysql':
                                    $type = 'integer';
                                    break;
                                default:
                                    $type = 'boolean';
                                    break;
                            }
                            break;
                        case 'decimal':
                        case 'float':
                            $type = 'float';
                            break;
                        default:
                            $type = 'mixed';
                            break;
                    }
                }

                $comment = $column->getComment();
                if (!$column->getNotnull()) {
                    $this->nullableColumns[$name] = true;
                }
                $this->setProperty($name, $type, true, true, $comment, !$column->getNotnull());
                if ($this->write_model_magic_where) {
                    $this->setMethod(
                        Str::camel("where_" . $name),
                        '\Illuminate\Database\Eloquent\Builder|\\' . get_class($model),
                        array('$value')
                    );
                }
            }
        }
    }
109301
protected function buildRowsFromModel($model): void
    {
        $this->model = $model = $this->buildModel($model);

        if ($model instanceof Paginator) {
            $this->setRowsData($model->items());
            $this->paginate = true;
        } elseif ($model instanceof Collection) {
            $this->setRowsData($model->all());
        } elseif ($model instanceof Arrayable) {
            $this->setRowsData($model->toArray());
        } elseif (\is_array($model)) {
            $this->setRowsData($model);
        } else {
            throw new InvalidArgumentException('Unable to convert $model to array.');
        }
    }
1316018
def _use_for_model(self, model):
        
        original_database = getattr(model, 'database', None)

        def get_models(model):
            """
            Return the model and all its submodels that are on the same database
            """
            model_database = getattr(model, 'database', None)
            if model_database == self:
                return []
            models = [model]
            for submodel in model.__subclasses__():
                if getattr(submodel, 'database', None) == model_database:
                    models += get_models(submodel)
            return models

        # put the model and all its matching submodels on the new database
        models = get_models(model)
        for _model in models:
            if not _model.abstract:
                self._add_model(_model)
                del original_database._models[_model._name]
            _model.database = self

        # return updated models
        return models
393010
def _getParameters(self):
        """"""
        param = self.query._getParameters() 
        outputNames = []
        for outputCol in self.__columns:
            outputNames.append(outputCol)            
        param.update({'colModel' : '"'+', '.join(outputNames)+'"'})        
        return param
513057
public function sources($model = null) {
		$params = compact('model');

		return Filters::run($this, __FUNCTION__, $params, function($params) {
			$schema = $this->connection->quote($this->_config['schema']);

			$sql  = "SELECT table_name as name FROM INFORMATION_SCHEMA.tables";
			$sql .= " WHERE table_schema = {$schema}";

			if (!$result = $this->_execute($sql)) {
				return null;
			}
			$sources = [];

			foreach ($result as $row) {
				$sources[] = $row[0];
			}
			return $sources;
		});
	}
738319
private function create($model)
    {
        $attrs = $this->getMutableAttributes($model);
        $this->db
            ->connect()
            ->insert($this->table, array_keys($attrs))
            ->execute(array_values($attrs));
        $model->{$this->key} = $this->db->lastInsertId();
    }
656187
public <S extends Model> int updateByModel(S model) {
        this.beforeCheck();

        Object primaryKey = AnimaUtils.getAndRemovePrimaryKey(model);

        StringBuilder sql = new StringBuilder(this.buildUpdateSQL(model, null));

        List<Object> columnValueList = AnimaUtils.toColumnValues(model, false);

        ifNotNullThen(primaryKey, () -> {
            sql.append(" WHERE ").append(this.primaryKeyColumn).append(" = ?");
            columnValueList.add(primaryKey);
        });

        return this.execute(sql.toString(), columnValueList);
    }
1219664
public <T> JdbcIndex<T> buildIndex(Class<T> model) {
        JdbcIndex<T> index = new JdbcIndex<>();

        index.setModelClass(model);
        index.setName(indexNameTranslator.translate(model));

        index.setFields(buildFields(index));

        return index;
    }
352819
public void setTableModel(final TableModel newmodel) {
		Runnable updateModel = new Runnable() {
			@Override
			public void run() {
				tblQueryResult.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
				ToolTipManager.sharedInstance().unregisterComponent(tblQueryResult);
				ToolTipManager.sharedInstance().unregisterComponent(tblQueryResult.getTableHeader());

				TableModel oldmodel = tblQueryResult.getModel();
				if (oldmodel != null) {
					oldmodel.removeTableModelListener(tblQueryResult);
					if (oldmodel instanceof IncrementalResultSetTableModel) {
						IncrementalResultSetTableModel incm = (IncrementalResultSetTableModel) oldmodel;
						incm.close();
					}
				}
				tblQueryResult.setModel(newmodel);

				addNotify();

				tblQueryResult.invalidate();
				tblQueryResult.repaint();
			}
		};
		SwingUtilities.invokeLater(updateModel);
		
		// Write a hint in the comment panel for user information
		writeHintMessage();
	}
470884
def get_columns(model=None, fields=None, meta=None):
    
    if model:
        M = get_model(model)
    else:
        M = None
    if fields is not None:
        f = fields

    if M:
        if meta and hasattr(M, meta):
            m = getattr(model, meta)
            if hasattr(m, 'fields'):
                f = m.fields
            else:
                f = M._fields_list
        else:
            f = M._fields_list

    columns = []
    for x in f:
        if isinstance(x, str):  # so x is field_name
            field_name = x
        elif isinstance(x, dict):
            field_name = x['name']
        else:
            raise UliwebError("Field definition is not right, it should be just like str or {'name':xxx}")

        if '.' in field_name:
            model_name, field_name = field_name.split('.')
            M = get_model(model_name)

        if not M:
            raise UliwebError("Model can't be empty, because field name not has `model.` prefix")

        if field_name in M.c:
            columns.append(M.c[field_name])

    return columns
9903
public void setInputModel(TreeModel model)
    {
        Enumeration<TreePath> expandedDescendants = 
            this.tree.getExpandedDescendants(new TreePath(treeModel.getRoot()));
        
        this.treeModel = new FilteredTreeModel(model);
        this.tree.setModel(treeModel);
        
        if (expandedDescendants != null)
        {
            while (expandedDescendants.hasMoreElements())
            {
                TreePath expanded = expandedDescendants.nextElement();
                TreePath translatedPath = 
                    JTrees.translatePath(treeModel, expanded);
                if (translatedPath != null)
                {
                    this.tree.expandPath(translatedPath);
                }
            }
        }
    }
129491
public function bindWithChapters(Garp_Model_Db &$model) {
        $chapterModel = new Model_Chapter();
        $contentNodeModel = new Model_ContentNode();
        $contentNodeModel->setCmsContext($model->isCmsContext());
        $chapterModel->bindModel(
            'content', array('modelClass' => $contentNodeModel)
        );

        foreach ($this->_config['contentTypes'] as $chapterType) {
            $chapterAlias = $this->_extractContentTypeAlias($chapterType);
            $options = $this->_extractContentTypeBindOptions($chapterType, $contentNodeModel);
            $contentNodeModel->bindModel($chapterAlias, $options);
        }

        $model->bindModel(
            'chapters', array('modelClass' => $chapterModel)
        );
    }