{"size": 3105, "ext": "js", "max_stars_repo_path": "LG/core/dataModel/survey/DataContext.js", "max_stars_repo_name": "SourceDecoded/JustBASE", "max_stars_repo_stars_event_min_datetime": "2016-08-30T05:24:23.000Z", "max_stars_repo_stars_event_max_datetime": "2016-11-25T16:42:31.000Z", "max_issues_repo_path": "packages/WebLib.2.0.0.724/content/lib/weblib/lib/BASE/LG/core/dataModel/survey/DataContext.js", "max_issues_repo_name": "jaredjbarnes/WoodlandCreatures", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/WebLib.2.0.0.724/content/lib/weblib/lib/BASE/LG/core/dataModel/survey/DataContext.js", "max_forks_repo_name": "jaredjbarnes/WoodlandCreatures", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 45.0, "max_line_length": 134, "alphanum_fraction": 0.6322061192}
﻿BASE.require([
    "BASE.data.DataContext",
    "LG.core.dataModel.core.Person",
    "LG.core.dataModel.core.PersonEmailAddress",
    "LG.core.dataModel.survey.Service",
    "LG.core.dataModel.survey.Answer",
    "LG.core.dataModel.survey.Category",
    "LG.core.dataModel.survey.PerformanceReviewSurveyResult",
    "LG.core.dataModel.survey.PossibleAnswer",
    "LG.core.dataModel.survey.PossibleAnswerSet",
    "LG.core.dataModel.survey.Question",
    "LG.core.dataModel.survey.SelectAnswer",
    "LG.core.dataModel.survey.Survey",
    "LG.core.dataModel.survey.SurveyResult",
    "LG.core.dataModel.survey.TextAnswer",
    "LG.core.dataModel.survey.TextQuestion"
], function () {

    BASE.namespace("LG.core.dataModel.survey");

    LG.core.dataModel.survey.DataContext = (function (Super) {

        var DataContext = function (appId, userToken) {
            var self = this;
            if (!(self instanceof arguments.callee)) {
                return new DataContext(appId, userToken);
            }

            Super.call(self);

            Object.defineProperty(self, "appId", {
                get: function () {
                    return appId;
                }
            });

            var _token = userToken;
            Object.defineProperty(self, "token", {
                get: function () {
                    return _token;
                },
                set: function (value) {
                    _token = value;
                    self.service.ajaxProvider.setToken(value);
                }
            });

            self.service = new LG.core.dataModel.survey.Service(appId, userToken, self.relationships);
            self.people = new BASE.data.DataSet(LG.core.dataModel.core.Person, self);
            self.personEmailAddresses = new BASE.data.DataSet(LG.core.dataModel.core.PersonEmailAddress, self);
            self.answers = new BASE.data.DataSet(LG.core.dataModel.survey.Answer, self);
            self.categories = new BASE.data.DataSet(LG.core.dataModel.survey.Category, self);
            self.performanceReviewSurveyResults = new BASE.data.DataSet(LG.core.dataModel.survey.PerformanceReviewSurveyResult, self);
            self.possibleAnswers = new BASE.data.DataSet(LG.core.dataModel.survey.PossibleAnswer, self);
            self.possibleAnswerSets = new BASE.data.DataSet(LG.core.dataModel.survey.PossibleAnswerSet, self);
            self.questions = new BASE.data.DataSet(LG.core.dataModel.survey.Question, self);
            self.selectAnswers = new BASE.data.DataSet(LG.core.dataModel.survey.SelectAnswer, self);
            self.surveys = new BASE.data.DataSet(LG.core.dataModel.survey.Survey, self);
            self.surveyResults = new BASE.data.DataSet(LG.core.dataModel.survey.SurveyResult, self);
            self.textAnswers = new BASE.data.DataSet(LG.core.dataModel.survey.TextAnswer, self);
            self.textQuestions = new BASE.data.DataSet(LG.core.dataModel.survey.TextQuestion, self);

            return self;
        };
        BASE.extend(DataContext, Super);

        return DataContext;
    }(BASE.data.DataContext));
});