[createModel description]
@return [type] [description]
979444
protected function createModel()
	{
		$name = str_singular( $this->name );
		$tmpl = file_get_contents( __DIR__ . "/Model.tmpl" );
		$tmpl = str_replace( [ '{{NAME}}', '{{NAMESPACE}}' ], [ $name, $this->namespace ], $tmpl );
		$path = app_path( "Models/{$name}.php" );
		if( ! file_exists( $path ) ) {
			file_put_contents( $path, $tmpl );
		}
	}
348167
protected function createModel()
    {
        $tracker = $this->loader->getTracker();
        $model   = $tracker->getRespondentTrackModel();

        if (! $this->trackEngine instanceof \Gems_Tracker_Engine_TrackEngineInterface) {
            if (! $this->respondentTrack) {
                $this->respondentTrack = $tracker->getRespondentTrack($this->respondentTrackId);
            }
            $this->trackEngine = $this->respondentTrack->getTrackEngine();
        }
        $model->applyEditSettings($this->trackEngine);

        return $model;
    }
36183
public function create()
    {
        // Create Response Model
        $response = new ResponseModel();

        // return response
        $response->setData(collect($this->model->getFillable()));
        $response->setMessage($this->getTrans('create', 'successful'));
        return SmartResponse::response($response);
    }
182021
public function create()
    {
        $this->data['mrkdwn_in'] = [];

        if ($this->markdownInText) {
            $this->data['mrkdwn_in'][] = 'text';
        }

        if ($this->markdownInPretext) {
            $this->data['mrkdwn_in'][] = 'pretext';
        }

        if ($this->markdownInFields) {
            $this->data['mrkdwn_in'][] = 'fields';
        }

        return Attachment::fromData($this->data);
    }
909338
protected function createModel()
    {
        $model = parent::createModel();

        $translated = $this->util->getTranslated();
        $model->set('calc_used_date',
                'formatFunction', $translated->formatDateNever,
                'tdClass', 'date');
        $model->set('gto_changed',
                'dateFormat', 'dd-MM-yyyy HH:mm:ss',
                'tdClass', 'date');

        return $model;
    }
701406
public function create() {
        if ($this->overrideAction('create')) {
            return;
        }

        $this->AdminToolbar->setBelongsToData($this->Model);
        $this->AdminToolbar->setHabtmData($this->Model);

        if ($this->request->is('post')) {
            $data = $this->AdminToolbar->getRequestData();
            $this->Model->create();

            if ($this->Model->saveAll($data, array('validate' => 'first', 'atomic' => true, 'deep' => true))) {
                $this->Model->set($data);
                $this->AdminToolbar->logAction(ActionLog::CREATE, $this->Model, $this->Model->id);

                $this->AdminToolbar->setFlashMessage(__d('admin', 'Successfully created a new %s', mb_strtolower($this->Model->singularName)));
                $this->AdminToolbar->redirectAfter($this->Model);

            } else {
                $this->AdminToolbar->setFlashMessage(__d('admin', 'Failed to create a new %s', mb_strtolower($this->Model->singularName)), 'is-error');
            }
        }

        $this->overrideView('create');
    }
1364998
@Override public PCAModel createImpl() {
    PCAModel.PCAParameters parms = parameters.createImpl();
    return new PCAModel( model_id.key(), parms, null );
  }
466378
protected function createModel()
    {
        $model = $this->token->getModel();

        $model->set('gto_reception_code',
            'label',        $model->get('grc_description', 'label'),
            'required',     true);

        return $model;
    }
924840
protected function createModel()
    {
        $model = $this->token->getSurveyAnswerModel($this->locale->getLanguage());

        $model->addColumn($this->util->getTokenData()->getStatusExpression(), 'token_status');

        $model->set('gto_valid_from', 'dateFormat', $this->dateFormat);
        $model->set('gto_completion_time', 'dateFormat', $this->dateFormat);

        return $model;
    }
534431
protected function createModel()
    {
        if (! $this->model instanceof \Gems_Tracker_Model_TrackModel) {
            $this->model = $this->loader->getTracker()->getTrackModel();
        }

        return $this->model;
    }
69762
protected function createModel()
    {
        $translated = $this->util->getTranslated();

        $model = new \MUtil_Model_TableModel('gems__tracks');

        $model->set('gtr_track_name',    'label', $this->_('Track'));
        $model->set('gtr_survey_rounds', 'label', $this->_('Survey #'));
        $model->set('gtr_date_start',    'label', $this->_('From'),
                'dateFormat', $translated->formatDate,
                'tdClass', 'date'
                );
        $model->set('gtr_date_until',    'label', $this->_('Until'),
                'dateFormat', $translated->formatDateForever,
                'tdClass', 'date'
                );

        return $model;
    }
128804
public function create()
    {
        $class = $this->getClass();
        $form = new $class();

        $schema = $this->schemaManager->create();
        $schema->setObjectClass($this->postManager->getClass());

        $form->setSchema($schema);

        return $form;
    }
1141327
protected function createModel()
    {
        if (! $this->exportModel instanceof \MUtil_Model_ModelAbstract) {
            $yesNo = $this->util->getTranslated()->getYesNo();

            $model = new \MUtil_Model_SessionModel('export_for_' . $this->request->getControllerName());

            $model->set('orgs', 'label', $this->_('Organization export'),
                    'default', 1,
                    'description', $this->_('Export the organizations for which the track is active'),
                    'multiOptions', $yesNo,
                    'required', true,
                    'elementClass', 'Checkbox');

            $model->set('fields', 'label', $this->_('Field export'));
            $fields = $this->trackEngine->getFieldNames();
            if ($fields) {
                $model->set('fields',
                        'default', array_keys($fields),
                        'description', $this->_('Check the fields to export'),
                        'elementClass', 'MultiCheckbox',
                        'multiOptions', $fields
                        );
            } else {
                $model->set('fields',
                        'elementClass', 'Exhibitor',
                        'value', $this->_('No fields to export')
                        );
            }

            $rounds = $this->trackEngine->getRoundDescriptions();
            $model->set('rounds', 'label', $this->_('Round export'));
            if ($rounds) {
                $defaultRounds = array();
                foreach ($rounds as $roundId => &$roundDescription) {
                    $round = $this->trackEngine->getRound($roundId);
                    if ($round && $round->isActive()) {
                        $defaultRounds[] = $roundId;
                    } else {
                        $roundDescription = sprintf($this->_('%s (inactive)'), $roundDescription);
                    }

                    $survey = $round->getSurvey();
                    if ($survey) {
                        $model->set('survey__' . $survey->getSurveyId(),
                                'label', $survey->getName(),
                                'default', $survey->getExportCode(),
                                'description', $this->_('A unique code indentifying this survey during track import'),
                                'maxlength', 64,
                                'required', true,
                                'size', 20,
                                'surveyId', $survey->getSurveyId()
                                );
                    }
                }
                $model->set('rounds',
                        'default', $defaultRounds,
                        'description', $this->_('Check the rounds to export'),
                        'elementClass', 'MultiCheckbox',
                        'multiOptions', $rounds
                        );
            } else {
                $model->set('rounds',
                        'elementClass', 'Exhibitor',
                        'value', $this->_('No rounds to export')
                        );
            }

            $this->exportModel = $model;
        }

        return $this->exportModel;
    }
976899
protected function createModel($data) {
		$modelClass = $this->getModel();
			
		$model = $modelClass::factory($data);

		if ($this->hasDatagate()) {
			$model->setDatagate($this->getDatagate());
		}
		
		if ($this->hasLocator()) {
			$model->setLocator($this->getLocator());
		}
		
		return $model;
	}
759405
protected function createModel()
    {
        if (!$this->_model instanceof \MUtil_Model_SelectModel) {
            $trackId = $this->trackId;

            $db     = $this->db;
            $select = $db->select()->distinct()->from('gems__rounds', ['gro_round_description', 'gro_round_description'])->where('gro_id_track = ?', $trackId);
            $rounds = $this->db->fetchPairs($select);

            $fields = [
                'gems__surveys.gsu_survey_name',
                'round_order' => new \Zend_Db_Expr('min(gro_id_order)')
            ];
            foreach ($rounds as $round) {
                $fields[$round] = new \Zend_Db_Expr('max(case when (gro_round_description = ' . $db->quote($round) . ' AND gro_condition IS NULL) then "X" when gro_round_description = ' . $db->quote($round) . ' then "C" else NULL end)');
            }
            $fields['filler'] = new \Zend_Db_Expr('COALESCE(gems__track_fields.gtf_field_name, gems__groups.ggp_name)');

            $sql = $this->db->select()->from('gems__rounds', [])
                    ->join('gems__surveys', 'gro_id_survey = gsu_id_survey', [])
                    ->joinLeft('gems__track_fields', 'gro_id_relationfield = gtf_id_field AND gtf_field_type = "relation"', array())
                    ->joinLeft('gems__groups', 'gsu_id_primary_group =  ggp_id_group', array())
                    ->where('gro_active = 1')   //Only active rounds
                    ->where('gro_id_track = ?', $trackId)
                    ->group(['gro_id_survey', 'filler'])
                    ->columns($fields);

            $model = new \MUtil_Model_SelectModel($sql, 'track-plan');
            //$model->setKeys(array('gsu_survey_name'));
            $model->resetOrder();
            $model->set('filler', 'label', $this->_('Filler'));
            $model->set('gsu_survey_name', 'label', $this->_('Survey'));            
            foreach ($rounds as $round) {
                $model->set($round, 'label', $round);
            }
            $this->_model = $model;
        }

        return $this->_model;
    }
1172955
public function actionCreate()
    {
        Yii::$app->getResponse()->format = 'json';
        $routes = Yii::$app->getRequest()->post('route', '');
        $routes = preg_split('/\s*,\s*/', trim($routes), -1, PREG_SPLIT_NO_EMPTY);
        $model = new Route();
        $model->addNew($routes);
        return $model->getRoutes();
    }
1286658
protected function createModel()
    {
        if (! $this->model instanceof \Gems_Model_AppointmentModel) {
            $this->model = $this->loader->getModels()->createAppointmentModel();
            $this->model->applyBrowseSettings();
        }
        $this->model->addColumn(new \Zend_Db_Expr("CONVERT(gap_admission_time, DATE)"), 'date_only');
        $this->model->set('date_only', 'dateFormat',
                \Zend_Date::WEEKDAY . ' ' . \Zend_Date::DAY_SHORT . ' ' .
                \Zend_Date::MONTH_NAME . ' ' . \Zend_Date::YEAR,
                'storageFormat', 'YYYY-MM-DD'
                );
        $this->model->set('gap_admission_time', 'label', $this->_('Time'),
                'dateFormat', 'HH:mm');

        $this->model->set('gr2o_patient_nr', 'label', $this->_('Respondent nr'));

        \Gems_Model_RespondentModel::addNameToModel($this->model, $this->_('Name'));

        // \MUtil_Model::$verbose = true;
        return $this->model;
    }