Show the Create Object Exemple
435548
protected function actionCreateObject()
	{
		$blockCenter = new XmlBlockCollection($this->_myWords->Value("OBJECT"), BlockPosition::Center);

		$breakLine = new XmlnukeBreakLine();

		$firstParagraph = new XmlParagraphCollection();
		$firstParagraph->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("OBJECTTEXT1")));
		$firstParagraph->addXmlnukeObject($breakLine);
		$firstParagraph->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("OBJECTTEXT2"), true, true, true, true));
		$firstParagraph->addXmlnukeObject($breakLine);
		$firstParagraph->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("OBJECTTEXT3")));

		$secondParagraph = new XmlParagraphCollection();
		$secondParagraph->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("OBJECTTEXT4")));
		$secondParagraph->addXmlnukeObject($breakLine);
		$secondParagraph->addXmlnukeObject($breakLine);

		$xmlnukeImage = new XmlnukeImage("common/imgs/logo_xmlnuke.gif");
		$link = new XmlAnchorCollection("engine:xmlnuke", "");
		$link->addXmlnukeObject(new XmlnukeText($this->_myWords->Value("CLICK")." -->"));
		$link->addXmlnukeObject($breakLine);
		$link->addXmlnukeObject($xmlnukeImage);
		$link->addXmlnukeObject($breakLine);
		$link->addXmlnukeObject(new XmlnukeText(" -- ".$this->_myWords->Value("CLICK")));
		$secondParagraph->addXmlnukeObject($link);
		$secondParagraph->addXmlnukeObject($breakLine);

		$thirdParagraph = new XmlParagraphCollection();
		$arrayOptions = array();
		$arrayOptions["OPTION1"] =  $this->_myWords->Value("OPTIONTEST1");
		$arrayOptions["OPTION2"] =  $this->_myWords->Value("OPTIONTEST2");
		$arrayOptions["OPTION3"] =  $this->_myWords->Value("OPTIONTEST3");
		$arrayOptions["OPTION4"] =  $this->_myWords->Value("OPTIONTEST4");
		$thirdParagraph->addXmlnukeObject(new XmlEasyList(EasyListType::UNORDEREDLIST, "name", "caption", $arrayOptions, "OP3"));

		$blockCenter->addXmlnukeObject($firstParagraph);
		$blockCenter->addXmlnukeObject($secondParagraph);
		$blockCenter->addXmlnukeObject($thirdParagraph);

		$blockLeft = new XmlBlockCollection($this->_myWords->Value("BLOCKLEFT"), BlockPosition::Left);
		$blockLeft->addXmlnukeObject($firstParagraph);

		$blockRight = new XmlBlockCollection($this->_myWords->Value("BLOCKRIGHT"), BlockPosition::Right);
		$blockRight->addXmlnukeObject($firstParagraph);

		$this->_document->addXmlnukeObject($blockCenter);
		$this->_document->addXmlnukeObject($blockLeft);
		$this->_document->addXmlnukeObject($blockRight);
	}
1074741
public function createAction() {
        $this->setStatusCode(201);
        $createObjects = $this->createActionProcess();

        if(sizeOf($createObjects) == 1) { //Default handling of passing in one
            $createObject = $createObjects[0];
            $this->setErrors($createObject->getErrors());
            $this->setStatusCode($createObject->getStatusCode());
            if(!is_null($createObject->getEntity())) {
                try {
                    $this->showActionInternal($createObject->getEntity());
                } catch(Exception $e) {
                    $this->handleError($e);
                } catch(ValidationException $e) {
                    $this->handleValidationError($e);
                } catch(AclException $e) {
                    $this->handleAclError($e);
                } catch(CatchableException $e) {
                    $this->handleCatchableError($e);
                }
            }
        } else {
            $this->setStatusCode(400);
            $hasOneSuccessful = false;
            $objects = [];
            foreach($createObjects as $createObject) {
                $object = new \stdClass();
                try {
                    if(!is_null($createObject->getEntity())) {
                        $hasOneSuccessful = true;
                        $object->{$createObject->getEntity()->getEntityName()} = $this->generateEntityAction($createObject->getEntity());
                    }
                    $object = $this->addErrorsAndStatus($createObject->getErrors(), $createObject->getStatusCode(), $object);
                } catch(Exception $e) {
                    $this->handleError($e);
                } catch(ValidationException $e) {
                    $this->handleValidationError($e);
                } catch(AclException $e) {
                    $this->handleAclError($e);
                } catch(CatchableException $e) {
                    $this->handleCatchableError($e);
                }
                $objects[] = $object;
            }
            $blankEntity = $this->generateEntity();
            $outputObject = $this->getOutputObject();
            $outputObject->{$blankEntity->getEntityName() . 's'} = $objects;
            $this->setOutputObject($outputObject);
            if($hasOneSuccessful) {
                $this->setStatusCode(201);
            }
        }


    }
234785
function createApplication() {
  var app = function(req, res, next) {
    app.handle(req, res, next);
  };

  mixin(app, EventEmitter.prototype, false);
  mixin(app, proto, false);

  // expose the prototype that will get set on requests
  app.request = Object.create(req, {
    app: { configurable: true, enumerable: true, writable: true, value: app }
  })

  // expose the prototype that will get set on responses
  app.response = Object.create(res, {
    app: { configurable: true, enumerable: true, writable: true, value: app }
  })

  app.init();
  return app;
}
74462
def create(self):
        

        # In the header.location there is the newly created object so get the id out of the url
        created_id = self._post_request(
            data=self.element_to_string(self.encode())
        ).headers.get('Location').split('/')[-1]
        return self.get(created_id)
882150
function initCreate (args) {
    // method name is moduleNameCreate
    var methodName = `${this.name}Create`
    // method signature is moduleName.methodname
    var methodSignature = `${this.moduleName}.${methodName}`
    // capture model to pass to function
    var model = this
    // add create method to module and to object instance
    this.createMeta = immutable.method(methodSignature, function (args) {
        return createMeta(model, args)
    }, {
        // disable freezing args
        freeze: false,
    })
}
964380
def create(example):
    """"""
    try:
        this_dir = os.path.dirname(os.path.realpath(__file__))
        example_dir = os.path.join(this_dir, os.pardir, "examples", example)
        shutil.copytree(example_dir, os.path.join(os.getcwd(), example))
        log("Example created.", delay=0)
    except TypeError:
        click.echo("Example '{}' does not exist.".format(example))
    except OSError:
        click.echo("Example '{}' already exists here.".format(example))
897866
def perform_create(self, data):
        

        instance = self.model(**data)
        self.request.dbsession.add(instance)
        self.request.dbsession.flush()
        return instance
237745
function new_instance()
	{
		if(!($tab = $this->table_name()))
			bors_throw("Try to get new db instance with undefined table");

		if(!$this->create_time(true))
			$this->set_create_time(time());

		if(!$this->modify_time(true))
			$this->set_modify_time(time());

//		$this->set_owner_id(bors()->user_id());
		$this->set_last_editor_id(bors()->user_id());

		$this->storage()->create($this);
	}
716903
public function create()
    {
        event(new BeforeCreate($this));

        $this->beforeCreate();

        $this->doCreate();

        $this->afterCreate();

        event(new AfterCreate($this));
    }
103680
def create(self, instance):
        
        with self.flushing():
            if instance.id is None:
                instance.id = self.new_object_id()
            self.session.add(instance)
        return instance
1022912
function (items, id_path, done) {

      done = typeof id_path == 'function' ? id_path : done

      var next = function(item, cb) {
        debug('creating %s', type)

        File.create(item[file_type], function(err, items) {
          if(err)
            return cb(err)

          item[file_type] = Array.prototype.slice.call(arguments, 1)
          debug('%s %s created', item[file_type].length, file_type)

          models[type].create(item, function(err, item) {
            if(err)
              return cb(err)

            debug('item created')

            if(id_path) {
              debug('Saving item to path')
              require('./paths')
              .files.add(id_path, item, function(err, path) {
                cb(err, item)
              })
            } else
              return cb(null, item)

          })
        })

      }

      if(items instanceof Array) {
        async.map(items, next,	done)
      } else {
        next(items, done)
      }
    }
56655
def create(self, request):
        """"""
        form = (self.form or generate_form(self.model))(request.POST)

        if form.is_valid():
            object = form.save()

            return self._render(
                request = request,
                template = 'show',
                context = {
                    cc2us(self.model.__name__): object
                },
                status = 201
            )
        else:
            return self._render(
                request = request,
                template = 'new',
                context = {
                    'form': form
                },
                status = 400
            )
829878
public function actionCreate()
    {
        $data = [
            'f1' => $this->getContext()->getInput()->post('p1'),
            'f2' => $this->getContext()->getInput()->post('p2'),
        ];

        $this->outputJson($data);
        //$this->outputJson(null, 'shibaile', 403);
    }
868613
function create(object, callback) {
    self.emit('create', object)
    callback = callback || emptyFn
    // clone the object
    var extendedObject = extend({}, object)

    if (!extendedObject[options.idProperty]) {
      idSeq += 1
      extendedObject[options.idProperty] = '' + idSeq
    } else {
      if (findById(extendedObject[options.idProperty]) !== null) {
        return callback(new Error('Key ' + extendedObject[options.idProperty] + ' already exists'))
      }
      // if an id is provided, cast to string.
      extendedObject[options.idProperty] = '' + extendedObject[options.idProperty]
    }
    data.push(extend({}, extendedObject))
    self.emit('afterCreate', extendedObject)
    callback(undefined, extendedObject)
  }
675987
@Override
    public Object createExample() {
        HistoryDTO history = new HistoryDTO();

        history.setCreationTime(System.currentTimeMillis());
        history.setHostName("localhost");
        history.setEntityId(BigInteger.TEN);
        history.setMessage("A description of the change or operation.");
        history.setJobStatus(JobStatus.SUCCESS);
        return history;
    }
104010
def created(self):
        ''
        return dateutil.parser.parse(str(self.f.currentRevision.created))
478929
async def create_object(model, **data):
    
    # NOTE! Here are internals involved:
    #
    # - obj._data
    # - obj._get_pk_value()
    # - obj._set_pk_value()
    # - obj._prepare_instance()
    #
    warnings.warn("create_object() is deprecated, Manager.create() "
                  "should be used instead",
                  DeprecationWarning)

    obj = model(**data)

    pk = await insert(model.insert(**dict(obj.__data__)))

    if obj._pk is None:
        obj._pk = pk
    return obj