    public static function getItems($term, $valueAttr='name', $nameAttr='id', $modelClass=null) {
        if (!$modelClass)
            $modelClass = Yii::app()->controller->modelClass;
        $model = X2Model::model($modelClass);

        if (isset($model)) {
            $modelClass::checkThrowAttrError (array ($valueAttr, $nameAttr));
            $tableName = $model->tableName();
            $qterm = $term . '%';
            $params = array (
                ':qterm' => $qterm,
            );
            $sql = "
                SELECT $nameAttr as id, $valueAttr as value 
                FROM " . $tableName . " as t
                WHERE $valueAttr LIKE :qterm";
            if ($model->asa ('permissions')) {
                list ($accessCond, $permissionsParams) = $model->getAccessSQLCondition ();
                $sql .= ' AND '.$accessCond;
                $params = array_merge ($params, $permissionsParams);
            }
                
            $sql .= "ORDER BY $valueAttr ASC";
            $command = Yii::app()->db->createCommand($sql);
            $result = $command->queryAll(true, $params);
            echo CJSON::encode($result);
        }
        Yii::app()->end();
    }
The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.