create definition

@param mixed $recordCount number for creation or $callback if not require $recordCount
@param callback|array $callback define block or array
@return FabricateDefinition created definition
179493
private function definition($recordCount, $callback)
    {
        if (is_callable($recordCount) || is_array($recordCount)) {
            $callback = $recordCount;
        }
        return new FabricateDefinition($callback);
    }
1095089
function (callback) {
    IdentityCounter.findOne({
      model: settings.model,
      field: settings.field
    }, function (err, counter) {
      if (err) return callback(err);
      callback(null, counter === null ? settings.startAt : counter.count + settings.incrementBy);
    });
  }
396535
public static function create_plan(stdClass $record) {
        global $USER;
        static::require_enabled();
        $plan = new plan(0, $record);

        if ($plan->is_based_on_template()) {
            throw new coding_exception('To create a plan from a template use api::create_plan_from_template().');
        } else if ($plan->get('status') == plan::STATUS_COMPLETE) {
            throw new coding_exception('A plan cannot be created as complete.');
        }

        if (!$plan->can_manage()) {
            $context = context_user::instance($plan->get('userid'));
            throw new required_capability_exception($context, 'moodle/competency:planmanage', 'nopermissions', '');
        }

        $plan->create();

        // Trigger created event.
        \core\event\competency_plan_created::create_from_plan($plan)->trigger();
        return $plan;
    }
268948
public function addRecord($record)
    {
        if ((isset($this->DBFHeader)) && (is_array($this->DBFHeader))) {
            $record->updateDBFInfo($this->DBFHeader);
        }

        $this->fileLength += ($record->getContentLength() + 4);
        $this->records[] = $record;
        $this->records[count($this->records) - 1]->recordNumber = count($this->records);

        $this->updateBBox('x', $record->SHPData);
        $this->updateBBox('y', $record->SHPData);

        if (in_array($this->shapeType, [11, 13, 15, 18, 21, 23, 25, 28])) {
            $this->updateBBox('m', $record->SHPData);
        }

        if (in_array($this->shapeType, [11, 13, 15, 18])) {
            $this->updateBBox('z', $record->SHPData);
        }

        return count($this->records) - 1;
    }
1305986
public function createRecord(
        $loggerNamespace,
        $loggerClass,
        $loggerMethod,
        $namespace,
        $class,
        $method,
        $level,
        $filename,
        $lineno,
        $msg,
        array $args,
        \Exception $exception = null
    ) {
        $record = new \Plop\Record(
            $loggerNamespace,
            $loggerClass,
            $loggerMethod,
            $namespace,
            $class,
            $method,
            $level,
            $filename,
            $lineno,
            $msg,
            $args,
            $this->interpolator,
            $exception
        );
        return $record;
    }
77640
public function createFromCallback($callback): SpyVerifier
    {
        return new SpyVerifier(
            $this->spyFactory->create($callback),
            $this->matcherFactory,
            $this->matcherVerifier,
            $this->generatorVerifierFactory,
            $this->iterableVerifierFactory,
            $this->callVerifierFactory,
            $this->assertionRecorder,
            $this->assertionRenderer
        );
    }
728590
private function createResource(callable $callback)
    {
        $errors = null;
        set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
            $errors[] = [
                'message' => $msg,
                'file'    => $file,
                'line'    => $line
            ];
            return true;
        });

        $resource = $callback();
        restore_error_handler();

        if (!$resource) {
            $message = 'Error creating resource: ';
            foreach ($errors as $err) {
                foreach ($err as $key => $value) {
                    $message .= "[$key] $value" . PHP_EOL;
                }
            }
            throw new \RuntimeException(trim($message));
        }

        return $resource;
    }
965553
public static function createChild(\Closure $callback)
    {
        $puid = Context::getcoroutine();
        return \Swoole\Coroutine::create(function () use ($puid,$callback){
            Context::markParent($puid);
            \Swoole\Coroutine::call_user_func($callback);
        });
    }
216260
public Future<WriteResponse> write(D record, @Nullable WriteCallback callback) {
    try {
      Future<RecordMetadata> future = this.accumulator.append(record, callback);
      return new WriteResponseFuture (future, WRITE_RESPONSE_WRAPPER);
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
125844
public function table($table, Closure $callback)
    {
        $this->build($this->createBlueprint($table, $callback));
    }
409737
public static function create(Closure $callback = null, $request = [])
    {
        return (is_callable($callback)) ?
            $callback(new static(Security::create(), $request)) :
            new static(Security::create(), $request);
    }
677014
public static function create($name, callable $callback, ...$arguments) {

        try {

            return  new RpcMethod($name, $callback, ...$arguments);

        } catch (Exception $e) {

            throw $e;

        }

    }
625671
private function createResource(callable $callback)
	{
		// Turn off error reporting while we try to initiate the request
		$level = error_reporting(0);
		$resource = call_user_func($callback);
		error_reporting($level);

		// If the resource could not be created, then grab the last error and
		// throw an exception.
		if (!is_resource($resource)) {
			$message = 'Error creating resource: ';
			foreach ((array) error_get_last() as $key => $value) {
				$message .= "[{$key}] {$value} ";
			}
			throw new \Exception(trim($message));
		}

		return $resource;
	}
1293084
function create(requestObj, callback) {
           
            var storage = this;

            callback = callback || function defaultPostCallback() {
                //setup Error Notification here
            };
            
            if ((typeof requestObj) === 'undefined' || requestObj === null) {
               callback();
               return this;
            }
            
            requestObj.data.id = this._generateUid();

			for (i = 0; i < storage.preprocessors.length; i++) {
                requestObj.data = storage.preprocessors[i](requestObj.data, requestObj);
            }
            this.storage[requestObj.data.id] = requestObj.data;
            
            var data = this.storage[requestObj.data.id];            

            for (i = 0; i < storage.processors.length; i++) {
                data = storage.processors[i](data);
            }
            callback(data);
            
            return this;
        }
1281787
public function createRecord($spaceId, $objectId, RecordParameters $parameters)
    {
        $requestData = $this->getDefaultRequestData('json', $parameters->exportToArray());
        $endpoint = vsprintf('projects/%s/spaces/%s/objects/%s/records', [
            $this->getProjectId(),
            $spaceId,
            $objectId,
        ]);

        return $this->sendRequest($endpoint, $requestData, static::HTTP_METHOD_POST);
    }
948322
public function create(array $credentials, \Closure $callback = null)
    {
        $user = $this->createUser($credentials);

        if ($callback)
        {
            if ($callback($user) === false)
            {
                return false;
            }
        }

        return $this->save($user);
    }
858199
public function createTable($table, Closure $callback)
    {
    	if($this->hasTable($table)) {
    		return hst_message('is has table');
    	}
        \Schema::connection($this->databaseName)->create($table, $callback);
		return true;
    }