code: public function getModel($primaryModel = null, $input = false)
      {
          if (is_null($primaryModel)) {
              $primaryModel = $this->primaryModel;
              if (isset($input['id'])) {
                  $primaryModel = $primaryModel::get($input['id']);
                  if (empty($primaryModel)) {
                      return false;
                  }
              } else {
                  $primaryModel = new $primaryModel();
              }
          }
          $primaryModel->tabularId = false;
  
          if ($input && $input['_moduleHandler']) {
              $moduleHandler = $input['_moduleHandler'];
              $primaryModel->_moduleHandler = $moduleHandler;
              unset($input['_moduleHandler']);
              $primaryModel->setAttributes($input);
          } else {
              $primaryModel->loadDefaultValues();
          }
  
          return $primaryModel;
      }
docs: Get model.
  
  @param [[@doctodo param_type:primaryModel]] $primaryModel [[@doctodo param_description:primaryModel]] [optional]
  @param boolean                              $input        [[@doctodo param_description:input]] [optional]
  
  @return unknown