@public

Create a new record.
191935
function create(dataID: DataID, typeName: string): Record {
  // See perf note above for why we aren't using computed property access.
  const record = {};
  record[ID_KEY] = dataID;
  record[TYPENAME_KEY] = typeName;
  return record;
}
969709
function create(item, store) {
      var data = store.rootData.asObject();
      // New item has id
      if (item[store.idProperty]) {
        // Check item duplicated
        if (!data[item[store.idProperty]]) {
          // Create item
          data[item[store.idProperty]] = item;
        } else {
          // Item already exists
          return vcomet.error.log(
            "store",
            "Item with id " + item[store.idProperty] + " already exists"
          );
        }
      } else {
        // Add id value to item
        item[store.idProperty] = Object.keys(data).length.toString();
        // Create item
        data[item[store.idProperty]] = item;
      }
      if (item[store.idProperty]) {
        // Update store data
        store.rootData = store.data = new Result(data, store, store.data.__sorted);
        // Update store data items length
        store.size = Object.keys(store.data).length;
        // Trigger onSourceChanged event
        vcomet.triggerCallback("onSourceChanged", store);
        return item;
      } else {
        return vcomet.error.log("store", "Incorrect item format");
      }
    }
1125257
final public function create() {
        global $DB, $USER;

        if ($this->raw_get('id')) {
            // The validation methods rely on the ID to know if we're updating or not, the ID should be
            // falsy whenever we are creating an object.
            throw new coding_exception('Cannot create an object that has an ID defined.');
        }

        if (!$this->is_valid()) {
            throw new invalid_persistent_exception($this->get_errors());
        }

        // Before create hook.
        $this->before_create();

        // We can safely set those values bypassing the validation because we know what we're doing.
        $now = time();
        $this->raw_set('timecreated', $now);
        $this->raw_set('timemodified', $now);
        $this->raw_set('usermodified', $USER->id);

        $record = $this->to_record();
        unset($record->id);

        $id = $DB->insert_record(static::TABLE, $record);
        $this->raw_set('id', $id);

        // We ensure that this is flagged as validated.
        $this->validated = true;

        // After create hook.
        $this->after_create();

        return $this;
    }
1111885
function create(req, res, next) {
  var body = req.body;
  body.user_id = req.session.user.id;

  db.posts.create(req.body, function(err, post) {
    if(err) { return next(err); }

    res.json(201, post);
    signals.emit('post:create', post);
  });
}
1020591
public function create()
    {
        $conn = $this->connection->getConnection();
        $db = r\db($this->connection->getDatabaseName());
        $db->tableCreate($this->table)->run($conn);
    }
716903
public function create()
    {
        event(new BeforeCreate($this));

        $this->beforeCreate();

        $this->doCreate();

        $this->afterCreate();

        event(new AfterCreate($this));
    }
1188636
def _create_record(name, field_defs, step_name, inputs, unlist, file_vs, std_vs, parallel):
    
    if field_defs:
        fields = []
        inherit = []
        inherit_all = False
        inherit_exclude = []
        for fdef in field_defs:
            if not fdef.get("type"):
                if fdef["id"] == "inherit":
                    inherit_all = True
                    inherit_exclude = fdef.get("exclude", [])
                else:
                    inherit.append(fdef["id"])
            else:
                cur = {"name": _get_string_vid(fdef["id"]),
                       "type": fdef["type"]}
                fields.append(_add_secondary_to_rec_field(fdef, cur))
        if inherit_all:
            fields.extend(_infer_record_outputs(inputs, unlist, file_vs, std_vs, parallel, exclude=inherit_exclude))
        elif inherit:
            fields.extend(_infer_record_outputs(inputs, unlist, file_vs, std_vs, parallel, inherit))
    else:
        fields = _infer_record_outputs(inputs, unlist, file_vs, std_vs, parallel)
    out = {"id": "%s/%s" % (step_name, name),
           "type": {"name": name,
                    "type": "record",
                    "fields": fields}}
    if parallel in ["batch-single", "multi-batch"]:
        out = _nest_variable(out)
    return out
191267
def create
      @record = Post.new(page_params)
      @record.additional_data(params[:additional_data])

      respond_to do |format|

        if @record.save
          format.html { redirect_to admin_pages_path, notice: I18n.t("controllers.admin.pages.create.flash.success") }
        else
          format.html {
            # add breadcrumb and set title
            add_breadcrumb I18n.t("controllers.admin.pages.new.breadcrumb")
            @action = 'create'
            flash[:error] = I18n.t('generic.validation.no_passed')
            render action: "new"
          }
        end

      end

    end
737324
public PTable makeNewPTable(FieldList record, Object key)
    {
        ZTable xTable = new ZTable(this, record, key);  // New empty table
        return xTable;
    }
127550
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('RR record already initialized!')

        self.rr_flags = 0
        self._initialized = True
838640
def create(cls, zone_id, record):
        """"""
        cls.echo('Creating new zone version')
        new_version_id = Zone.new(zone_id)

        cls.echo('Updating zone version')
        cls.add(zone_id, new_version_id, record)

        cls.echo('Activation of new zone version')
        Zone.set(zone_id, new_version_id)

        return new_version_id
721488
@Create
	public MethodOutcome create(@ResourceParam Patient thePatient) {
		// Give the resource the next sequential ID
		long id = myNextId++;
		thePatient.setId(new IdDt(id));
		
		// Store the resource in memory
		myPatients.put(id, thePatient);
		
		// Inform the server of the ID for the newly stored resource
		return new MethodOutcome(thePatient.getId());	
	}
1211405
def create!(attributes)
      new_attributes = map_to_keys(attributes)

      new_attributes = new_attributes.merge(
        RecordTypeManager::FIELD_NAME => klass.record_type_id
      ) if klass.record_type_id

      client.create!(klass.object_name, new_attributes)
    end
1330106
def new_record(self, key, value):
    
    new_record = self.get('new_record', {})
    ids = self.get('ids', [])

    for value in force_list(value):
        for id_ in force_list(value.get('a')):
            ids.append({
                'schema': 'SPIRES',
                'value': id_,
            })

        new_recid = force_single_element(value.get('d', ''))
        if new_recid:
            new_record = get_record_ref(new_recid, 'authors')

    self['ids'] = ids
    return new_record
1215280
def create_new_migration_record(self):
        
        migration_record = self.migration_model(
            name=self.name,
            version=self.latest_migration)
        self.session.add(migration_record)
        self.session.commit()
470310
def new(self, data):
        """"""
        data = self.__model__._get_non_empty_dict(data)
        return self.__class__(
            self.__five9__,
            self.__model__,
            records=[self.__model__.deserialize(data)],
        )
947154
def create(self, **attributes):
        
        record = self.build(**attributes)
        record.save()
        return record