Create a term.

@return object
The created term.
189251
public function termCreate($term)
    {
        $this->dispatchHooks('BeforeTermCreateScope', $term);
        $this->parseEntityFields('taxonomy_term', $term);
        $saved = $this->getDriver()->createTerm($term);
        $this->dispatchHooks('AfterTermCreateScope', $saved);
        $this->terms[] = $saved;
        return $saved;
    }
619390
public function createTerm(string $term, string $taxonomy, array $args = []): array
    {
        $args['taxonomy'] = $taxonomy;
        $args['term'] = $term;

        $term = $this->getDriver()->term->create($args);

        return array(
            'id'   => $term->term_id,
            'slug' => $term->slug
        );
    }
300381
public function create()
    {
        $now = $this->now();
        $zeroPrice = $this->createZeroAmountMoney();

        /**
         * @var CouponInterface $coupon
         */
        $classNamespace = $this->getEntityNamespace();
        $coupon = new $classNamespace();
        $coupon
            ->setType(ElcodiCouponTypes::TYPE_AMOUNT)
            ->setPrice($zeroPrice)
            ->setAbsolutePrice($zeroPrice)
            ->setMinimumPurchase($zeroPrice)
            ->setEnforcement(ElcodiCouponTypes::ENFORCEMENT_MANUAL)
            ->setUsed(0)
            ->setCount(0)
            ->setPriority(0)
            ->setStackable(false)
            ->setEnabled(false)
            ->setCreatedAt($now)
            ->setValidFrom($now);

        return $coupon;
    }
828094
public function create()
    {
        /**
         * @var LanguageInterface $language
         */
        $classNamespace = $this->getEntityNamespace();
        $language = new $classNamespace();

        $language->setEnabled(false);

        return $language;
    }
1144156
public function create()
    {
        return $this->makeResponse('create', [
            'file' => [],
            'articles' => Article::when('owner' != user('role'), function ($query) {
                    $query->where('user_id', user('id'));
                })
                ->latest()
                ->get() ?? [],
        ]);
    }
17934
public function create()
    {
        $zeroPrice = $this->createZeroAmountMoney();

        /**
         * @var Product $product
         */
        $classNamespace = $this->getEntityNamespace();
        $product = new $classNamespace();

        $stock = $this->useStock
            ? 0
            : ElcodiProductStock::INFINITE_STOCK;

        $product
            ->setStock($stock)
            ->setType(ElcodiProductTypes::TYPE_PRODUCT_PHYSICAL)
            ->setShowInHome(true)
            ->setPrice($zeroPrice)
            ->setReducedPrice($zeroPrice)
            ->setAttributes(new ArrayCollection())
            ->setVariants(new ArrayCollection())
            ->setCategories(new ArrayCollection())
            ->setImages(new ArrayCollection())
            ->setWidth(0)
            ->setHeight(0)
            ->setDepth(0)
            ->setWidth(0)
            ->setWeight(0)
            ->setImagesSort('')
            ->setEnabled(true)
            ->setCreatedAt($this->now());

        return $product;
    }
910562
public function create()
    {
        /**
         * @var CartLine $cartLine
         */
        $classNamespace = $this->getEntityNamespace();
        $cartLine = new $classNamespace();
        $cartLine
            ->setAmount($this->createZeroAmountMoney())
            ->setPurchasableAmount($this->createZeroAmountMoney());

        return $cartLine;
    }
1293806
protected function _createObject( $args ) {
		$args = array_merge( array( 'taxonomy' => $this->_taxonomy ), $args );
		$term_id_pair = wp_insert_term( $args['name'], $args['taxonomy'], $args );
		if ( is_wp_error( $term_id_pair ) ) {
			$this->_debug(
				'Term generation failed with message [%s] %s',
				$term_id_pair->get_error_code(),
				$term_id_pair->get_error_messages()
			);

			return $term_id_pair;
		}

		$this->_debug( 'Generated term ID: ' . $term_id_pair['term_id'] );

		return $term_id_pair['term_id'];
	}
451631
protected function createModel()
    {
        $model = parent::createModel();

        foreach ($model->getItemNames() as $name) {
            if (! $model->has($name, 'label')) {
                $model->set($name, 'label', ' ');
            }
        }

        return $model;
    }
995996
public function create()
    {
        /**
         * @var Tax $tax
         */
        $classNamespace = $this->getEntityNamespace();
        $tax = new $classNamespace();
        $tax
            ->setName('')
            ->setDescription('')
            ->setValue(0)
            ->setEnabled(false);

        return $tax;
    }
777413
public function create_item( $request ) {
		if ( isset( $request['parent'] ) ) {
			if ( ! is_taxonomy_hierarchical( $this->taxonomy ) ) {
				return new WP_Error( 'rest_taxonomy_not_hierarchical', __( 'Can not set resource parent, taxonomy is not hierarchical.' ), array( 'status' => 400 ) );
			}

			$parent = get_term( (int) $request['parent'], $this->taxonomy );

			if ( ! $parent ) {
				return new WP_Error( 'rest_term_invalid', __( "Parent resource doesn't exist." ), array( 'status' => 400 ) );
			}
		}

		$prepared_term = $this->prepare_item_for_database( $request );

		$term = wp_insert_term( $prepared_term->name, $this->taxonomy, $prepared_term );
		if ( is_wp_error( $term ) ) {

			/*
			 * If we're going to inform the client that the term already exists,
			 * give them the identifier for future use.
			 */
			if ( $term_id = $term->get_error_data( 'term_exists' ) ) {
				$existing_term = get_term( $term_id, $this->taxonomy );
				$term->add_data( $existing_term->term_id, 'term_exists' );
			}

			return $term;
		}

		$term = get_term( $term['term_id'], $this->taxonomy );

		/**
		 * Fires after a single term is created or updated via the REST API.
		 *
		 * @param WP_Term         $term     Inserted Term object.
		 * @param WP_REST_Request $request  Request object.
		 * @param boolean         $creating True when creating term, false when updating.
		 */
		do_action( "rest_insert_{$this->taxonomy}", $term, $request, true );

		$schema = $this->get_item_schema();
		if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) {
			$meta_update = $this->meta->update_value( $request['meta'], (int) $request['id'] );
			if ( is_wp_error( $meta_update ) ) {
				return $meta_update;
			}
		}

		$fields_update = $this->update_additional_fields_for_object( $term, $request );
		if ( is_wp_error( $fields_update ) ) {
			return $fields_update;
		}

		$request->set_param( 'context', 'view' );
		$response = $this->prepare_item_for_response( $term, $request );
		$response = rest_ensure_response( $response );
		$response->set_status( 201 );
		$response->header( 'Location', rest_url( $this->namespace . '/' . $this->rest_base . '/' . $term->term_id ) );
		return $response;
	}
682138
public function CreatePage()
	{
		parent::CreatePage();

		$this->myWords = $this->WordCollection();
		$this->setTitlePage($this->myWords->Value("TITLE"));
		$this->setHelp($this->myWords->Value("DESCRIPTION"));

		$block = new XmlBlockCollection($this->myWords->Value("BLOCK_TITLE"), BlockPosition::Center);

		$anydatafile = new AnydatasetFilenameProcessor("_db");

		if ($this->_action != "test")
		{

			$processfields = new CrudFieldCollection();

			$field = new CrudField();
			$field->fieldName = "dbname";
			$field->editable = true;
			$field->key = true;
			$field->visibleInList = true;
			$field->dataType = INPUTTYPE::TEXT;
			$field->fieldXmlInput = XmlInputObjectType::TEXTBOX;
			$field->fieldCaption = $this->myWords->Value("DBNAME");
			$field->size = 20;
			$field->maxLength = 20;
			$field->required = true;
			$field->newColumn = true;
			$processfields->addCrudField($field);

			$field = new CrudField();
			$field->fieldName = "dbtype";
			$field->editable = true;
			$field->key = false;
			$field->visibleInList = true;
			$field->dataType = INPUTTYPE::TEXT;
			$field->fieldXmlInput = XmlInputObjectType::SELECTLIST;
			$field->fieldCaption = $this->myWords->Value("DBTYPE");
			$field->size = 15;
			$field->maxLength = 15;
			$field->required = true;
			$field->arraySelectList = array("dsn"=>"dsn (use it)",
				"literal"=>"PDO Literal connection string",
				"dblib"=>"FreeTDS / Microsoft SQL Server / Sybase",
				"firebird"=>"Firebird/Interbase 6",
				"informix"=>"IBM Informix Dynamic Server",
				"mysql"=>"MySQL 3.x/4.x/5.x",
				"oci"=>"Oracle Call Interface",
				"odbc"=>"ODBC v3 (IBM DB2, unixODBC and win32 ODBC)",
				"pgsql"=>"PostgreSQL",
				"sqlite"=>"SQL Lite");
			$field->defaultValue = "dsn";
			$field->newColumn = true;
			$processfields->addCrudField($field);

			$field = new CrudField();
			$field->fieldName = "dbconnectionstring";
			$field->editable = true;
			$field->key = false;
			$field->visibleInList = true;
			$field->dataType = INPUTTYPE::TEXT;
			$field->fieldXmlInput = XmlInputObjectType::TEXTBOX;
			$field->fieldCaption = $this->myWords->Value("DBCONNECTIONSTRING");
			$field->size = 50;
			$field->maxLength = 200;
			$field->required = true;
			$field->defaultValue = "adodriver://username:password@server/datasource?persist";
			$field->newColumn = true;
			$processfields->addCrudField($field);

			$buttons = new CustomButtons();
			$buttons->action = "test";
			$buttons->alternateText = $this->myWords->Value("TESTALTERNATETEXT");
			$buttons->enabled = true;
			$buttons->icon = "common/editlist/ic_selecionar.gif";
			$buttons->message = $this->myWords->Value("TESTMESSAGETEXT");
			$buttons->multiple = MultipleSelectType::ONLYONE;

			$crud =
				new XmlnukeCrudAnydata(
					$this->_context,
					$processfields,
					$this->myWords->Value("AVAILABLELANGUAGES"),
					"module:Xmlnuke.Admin.ManageDBConn",
					array($buttons),
					$anydatafile
				);

			$block->addXmlnukeObject($crud);

			$p = new XmlParagraphCollection();
			$p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("NOTE"), true));
			$p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("PHPNOTE")));
			$block->addXmlnukeObject($p);
		}
		else
		{
			$p = new XmlParagraphCollection();
			$db = $this->_context->get("valueid");
			if ($db == "")
			{
				$p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("ERRORDBEMPTY")));
			}
			else
			{
				try
				{
					$dbdataset = new DBDataset($db);
					$dbdataset->TestConnection();
					$p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("SEEMSOK")));
				}
				catch (Exception $ex)
				{
					$p->addXmlnukeObject(new XmlnukeText($this->myWords->Value("GOTERROR", $ex->getMessage())));
				}
			}
			$block->addXmlnukeObject($p);
			$p = new XmlParagraphCollection();
			$href = new XmlAnchorCollection("module:Xmlnuke.Admin.ManageDBConn");
			$href->addXmlnukeObject(new XmlnukeText($this->myWords->Value("GOBACK")));
			$p->addXmlnukeObject($href);
			$block->addXmlnukeObject($p);
		}

		$this->defaultXmlnukeDocument->addXmlnukeObject($block);
		return $this->defaultXmlnukeDocument->generatePage();
	}
741356
public function CreatePage()
	{
		$myWords = $this->WordCollection();

		$this->defaultXmlnukeDocument = new XmlnukeDocument($myWords->Value("TITLE"),"");
		
		$blockcenter = new XmlBlockCollection($this->_ErrorMessage['MESSAGE'], BlockPosition::Center );
		$this->defaultXmlnukeDocument->addXmlnukeObject($blockcenter);
		
		$paragraph = new XmlParagraphCollection();
		$blockcenter->addXmlnukeObject($paragraph);
		
		$paragraph->addXmlnukeObject($this->_ErrorMessage['TYPE'] . ' ' . $this->_ErrorMessage['OBJECT']);

		return $this->defaultXmlnukeDocument->generatePage();
	}
665917
private function createWord()
    {

        $this->word ='';
        for($x=0;$x<rand(5,7);$x++){

            $this->word .=$this->allowed_characters[ rand(0, strlen($this->allowed_characters)-1)];
        }
        return $this->word;
    }
1230330
public function create()
    {
        $instance = self::createCollection($this);
        $this->setId($instance->getId());
        return $instance;
    }
128804
public function create()
    {
        $class = $this->getClass();
        $form = new $class();

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

        $form->setSchema($schema);

        return $form;
    }
651761
public function create()
    {
        if (! $this->adapter->fileExists($this->path, true)) {
            // ensure the parent directory exists
            new Directory(dirname($this->path), $this->adapter);

            if ($this->adapter->createFile($this->path) === false) {
                $this->throwUnableToCreate();
            }
        }

        return $this;
    }