Create the defined model.

@param array $definition See {@link self::validate_models_declaration()} for the syntax.
@return \core_analytics\model
546101
public static function create_declared_model(array $definition): \core_analytics\model {

        list($target, $indicators) = static::get_declared_target_and_indicators_instances($definition);

        if (isset($definition['timesplitting'])) {
            $timesplitting = $definition['timesplitting'];
        } else {
            $timesplitting = false;
        }

        $created = \core_analytics\model::create($target, $indicators, $timesplitting);

        if (!empty($definition['enabled'])) {
            $created->enable();
        }

        return $created;
    }
845427
public function create(array $data) : Model
    {
        $model_class = $this->getModelName();
        return $this->postCreate($data, $model_class::create($this->preCreate($this->parseData($data))));
    }
679716
public function set($name, $definition) {
        $this->services[$name] = new Service($name, $definition);
        return $definition;
    }
428509
protected function _create(array $data) {
        $this->_validateLoadable();
        $snippetModel = new Model_Snippet();
        try {
            $snippetID = $snippetModel->insert($data);
            $snippet = $snippetModel->fetchRow(
                $snippetModel->select()->where('id = ?', $snippetID)
            );
            return $snippet;
        } catch (Garp_Model_Validator_Exception $e) {
            Garp_Cli::errorOut($e->getMessage());
        }
    }
696469
protected function createParameter(\stdClass $definition)
    {
        if ($definition->in === Parameter::IN_BODY) {
            $definition->schema       = isset($definition->schema) ? $definition->schema : (object)[];
            $definition->schema->type = $definition->schema->type ?: 'object';
        }
        if (isset($definition->schema)) {
            $schema = $this->schemaFactory->create($definition->schema);
        } else {
            $schema = $this->createParameterSchema($definition);
        }

        $required         = isset($definition->required) && $definition->required;
        $collectionFormat = isset($definition->collectionFormat) ? $definition->collectionFormat : null;

        return new Parameter($definition->name, $required, $schema, $definition->in, $collectionFormat);
    }
249752
public function bind(Definition $definition) {
        $this->arguments = [];
        $this->options = [];
        $this->definition = $definition;

        $this->parse();
    }
1117722
public function create(Array $input)
    {
        $result = $this->model->create($input);

        return $this->export($result);
    }
277393
public static function createFromApiJsonDocs($definition)
    {
        if (arr::get('group', $definition) == 'deprecated') {
            return;
        }

        $operation = new static();

        $operation->version = (arr::get('group', $definition) == 'streams')
            ? 'stream'
            : arr::get('api_version', $definition, '1');

        $operation->httpMethod = arr::get('http_method', $definition);
        $operation->summary = arr::get('desc', $definition);
        $operation->notes = arr::get('param_notes', $definition);
        $operation->parsePath(arr::get('path', $definition));

        foreach (arr::get('params', $definition, array()) as $param => $desc) {
            // Always false due to complex rules on meetup's side (one of x is required)
            $operation->addParameter(str_replace('*', '', $param), 'query', false, $desc);
        }

        foreach (arr::get('orders', $definition, array()) as $param => $desc) {
            $operation->addParameter($param, 'query', false, $desc);
        }

        $operation->addStandardParameters(arr::get('http_method', $definition));

        $operation->name = OperationNameConverter::parseOperationName($operation);

        return $operation;
    }
913620
public static function create(array $attributes = [])
    {
        return tap(self::make(call_user_func_array([static::$client, 'create'], func_get_args())), function ($model) {
            $model->exists = true;
        });
    }
187428
private function buildDateMetadataCreated(CriterionDefinition $definition)
    {
        return new DateMetadata(
            DateMetadata::CREATED,
            $definition->operator,
            $this->resolveTimeValues($definition->value)
        );
    }
314075
private function resolve(Definition $definition)
    {
        if(!$this->container->isFrozen()) {
            throw new \LogicException("cannot use create method on factory without freezing/compiling container");
        }
        $subContainer = new ContainerBuilder();
        $subContainer->merge($this->container);
        $subContainer->setDefinition("__tmp__", $definition);
        $subContainer->compile();
        $obj = $subContainer->get("__tmp__");
        return $obj;
    }
1068894
public function compile($definition)
    {
        $validators = [];

        if (isset($definition->validators)) {
            if (isset($definition->validators['properties'])) {
                foreach ($definition->validators['properties'] as $property => $validatorDefinitions) {
                    foreach ($validatorDefinitions as $validator) {
                        $validators[$property][] = parent::compile($validator);
                    }
                }
            }
        }

        return new ObjectValidator($validators);
    }
848934
public function create(array $spec = [])
    {
        $this->ensureRequiredAttributes($spec);

        $type = $spec['attributes']['type'];
        $name = $spec['attributes']['name'];

        $element = $this->buildElement($type, $name);

        if ($element instanceof ChoiceElementInterface) {
            $element = $this->configureChoiceElement($element, $spec);
        }

        if ($element instanceof LabelAwareInterface) {
            $element = $this->configureLabel($element, $spec);
        }

        if ($element instanceof ErrorAwareInterface) {
            $element = $this->configureErrors($element, $spec);
        }

        if ($element instanceof CollectionElementInterface) {
            $element = $this->configureEollection($element, $spec);
        }

        if ($element instanceof DescriptionAwareInterface) {
            $element = $this->configureDescription($element, $spec);
        }

        $element = $this->configureElement($element, $spec);

        return $element;
    }
1197594
public static function createFromFieldset($definition)
    {
        $definition = self::parseDefinition($definition);
        $root       = new Group();
        $group      = $root;

        /** @var bool|Dropdown $dropdown */
        $dropdown = false;
        $first    = true;

        foreach ($definition as $button) {
            // dont add empty items
            if (self::isInvalidDefinition($button)) {
                continue;
            }

            // encode value
            $button = self::encodeValue($button);

            // finish dropdown
            if (self::hasToCloseDropdown($dropdown, $button)) {
                $dropdown = false;
            }

            if (in_array($button['type'], array('group', 'vgroup'))) {
                // create new group
                $group = self::createNewGroup($root, $button, $dropdown, !$first);
            } elseif ($button['type'] == 'dropdown') {
                // create dropdown

                $dropdown      = static::createDropdown($button['label'], $button['attributes'], true);
                $dropdownGroup = static::createGroup();
                $dropdownGroup->addChild($dropdown);

                $group->addChild($dropdownGroup);
            } elseif ($button['type'] == 'child' || $button['type'] == 'header') {
                // add dropdown child

                static::parseDropdownChild($dropdown, $button);
            } elseif ($dropdown !== false) {
                $child = static::createDropdownItem($button['label'], $button['url'], $button['attributes'], true);
                $dropdown->addChild($child);
            } else {
                $child = static::createButton($button['label'], $button['url'], $button['attributes'], true);
                $group->addChild($child);
            }

            $first = false;
        }

        return $root;
    }
1250187
protected function buildSortedMap(array $definition) {
		$sortArgs = [];
		
		foreach ($definition as $definitionPart) {
			list($property, $direction) = $this->parseSortDefinition($definitionPart);
			
			$sortArgs[] = $this->getDataColumn($property);
			$sortArgs[] = $direction;
		}
		
		$this->_map = array_keys($this->_data);
		$sortArgs[] = &$this->_map;
		
		call_user_func_array('array_multisort', $sortArgs);
	}
410785
public static function create($definition)
    {
        if ($definition instanceof FabricateDefinition) {
            return new FabricateDefinitionFactory($definition);
        }
        if ($definition instanceof FabricateModel) {
            return new FabricateModelFactory($definition);
        }
        throw new \InvalidArgumentException("FabricateFactory is not support instance");
    }
1123904
public function create(array $attributes)
    {
        if (!is_null($this->validator)) {
            // we should pass data that has been casts by the model
            // to make sure data type are same because validator may need to use
            // this data to compare with data that fetch from database.
            if( $this->versionCompare($this->app->version(), "5.2.*", ">") ){
                $attributes = $this->model->newInstance()->forceFill($attributes)->makeVisible($this->model->getHidden())->toArray();
            }else{
                $model = $this->model->newInstance()->forceFill($attributes);
                $model->addVisible($this->model->getHidden());
                $attributes = $model->toArray();
            }

            $this->validator->with($attributes)->passesOrFail(ValidatorInterface::RULE_CREATE);
        }

        $model = $this->model->newInstance($attributes);
        $model->save();
        $this->resetModel();

        event(new RepositoryEntityCreated($this, $model));

        return $this->parserResult($model);
    }