Creates a new ScheduledTask.

@param array $data

@return ScheduledTask
180674
public function create(array $data)
    {
        if ($this->configHandler->hasParameter('is_cron_configured') &&
            $this->configHandler->getParameter('is_cron_configured')) {
            return $this->update($data, new ScheduledTask());
        }

        return null;
    }
758259
public function generateManualScheduledTasks(array $data)
    {
        $tasks = [];
        $date = isset($data['date']) ? new \DateTime($data['date']) : new \DateTime();
        $notificationsData = isset($data['notifications']) ? $data['notifications'] : [];
        $usersData = isset($data['users']) ? $data['users'] : [];

        $this->om->startFlushSuite();

        foreach ($notificationsData as $notification) {
            foreach ($usersData as $user) {
                $name = $notification['message']['title'];
                $name .= ' ('.$user['username'].')';
                $name .= ' [+'.$notification['parameters']['interval'].']';
                $scheduledDate = clone $date;
                $scheduledDate->add(new \DateInterval('P'.$notification['parameters']['interval'].'D'));

                $data = [
                    'name' => $name,
                    'scheduledDate' => $scheduledDate->format('Y-m-d\TH:i:s'),
                    'workspace' => [
                        'id' => $notification['workspace']['id'],
                    ],
                    'data' => [
                        'object' => $notification['message']['title'],
                        'content' => $notification['message']['content'],
                    ],
                    'users' => [
                        ['id' => $user['autoId']],
                    ],
                ];

                if ($notification['parameters']['byMail']) {
                    $data['type'] = 'email';
                    $task = $this->scheduledTaskManager->create($data);
                    $tasks[] = $task;
                }
                if ($notification['parameters']['byMessage']) {
                    $data['type'] = 'message';
                    $task = $this->scheduledTaskManager->create($data);
                    $tasks[] = $task;
                }
            }
        }
        $this->om->endFlushSuite();

        return $tasks;
    }
409696
public function create(array $data)
    {
        if (array_key_exists("image", $data)) {
            if (class_exists('\CURLFile')) {
                $data["image"] = new \CURLFile($data['image']);
            } else {
                $data["image"] = '@' . $data['image'];
            }
        }

        $response = $this->request->post("pins", $data);
        return new Pin($this->master, $response);
    }
307328
public static function createFromData(array $data)
    {
        if (!isset($data['method'])) {
            throw new DomainException(self::MSG_REQUIRED_METHOD);
        }

        switch ($data['method']) {
            case PaymentMethod::METHOD_ACH:
                $paymentInstrument = new AchInstrument($data);

                break;
            case PaymentMethod::METHOD_CASH:
                $paymentInstrument = new CashInstrument($data);

                break;
            case PaymentMethod::METHOD_PAYMENT_CARD:
                $paymentInstrument = new PaymentCardInstrument($data);

                break;
            case PaymentMethod::METHOD_PAYPAL:
                $paymentInstrument = new PayPalInstrument($data);

                break;
            default:
                throw new DomainException(
                    sprintf(self::MSG_UNSUPPORTED_METHOD, implode(',', self::$supportMethods))
                );
        }

        return $paymentInstrument;
    }
536594
public static function createExisting($data)
    {
        $newRequest = new static($data);
        $newRequest->setId($data['id']);
        $newRequest->setExists(true);

        return $newRequest;
    }
64491
protected function create(array $data)
    {
        return User::create([
            'first_name' => $data['first_name'],
            'last_name' => $data['last_name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);
    }
1279263
public function create(array $data)
  {
    $CostCenter = new CostCenter();
    $CostCenter->setConnection($this->databaseConnectionName);
    $CostCenter->fill($data)->save();

    return $CostCenter;
  }
1167685
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['filename'])) {
            $self->setFilename($data['filename']);
        }
        if (isset($data['format'])) {
            $self->setFormat($data['format']);
        }
        if (isset($data['state'])) {
            $self->setState($data['state']);
        }
        if (isset($data['created_at'])) {
            $self->setCreatedAt($data['created_at']);
        }

        return $self;
    }
630573
public function create(array $data) {
        $this->_checkAcl('create');
        $pk = $this->_model->insert($data);
        return $pk;
    }
298166
public function create(array $data = array())
    {
        if (!isset($data["configPathPrefix"])) {
            $data["configPathPrefix"] = $this->configPathPrefix;
        }
        return $this->_objectManager->create($this->_instanceName, $data);
    }
348303
public function create($data)
    {
        $methodDescriptor = new MethodDescriptor();
        $this->mapReflectorToDescriptor($data, $methodDescriptor);

        $this->assembleDocBlock($data->getDocBlock(), $methodDescriptor);
        $this->addArguments($data, $methodDescriptor);
        $this->addVariadicArgument($data, $methodDescriptor);

        return $methodDescriptor;
    }
1180202
public function create(array $data = [])
    {
        $lists = new Lists();

        if (array_key_exists('items', $data)) {
            $lists->setItems(
                $this->getListItemFactory()->createCollection($data['items'])
            );
        }

        /** Images */
        if (array_key_exists('poster_path', $data)) {
            $lists->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
        }

        return $this->hydrate($lists, $data);
    }
850183
public static function create($name = null, $data = null, \Closure $ready = null)
    {
        $task = new self($data);
        $task->name($name);
        if (is_callable($ready)) {
            call_user_func($ready, $task);
        }

        return $task;
    }
472854
public function create(array $data): Poll
    {
        $poll = new Poll($data['id'], $this);
        $poll
            ->setType($data['type'])
            ->setTitle($data['title'])
            ->setState($data['state'])
            ->setMultiDay((bool)$data['multiDay'])
            ->setByInvitation((bool)$data['byInvitation'])
            ->setInviteesCount((int)$data['inviteesCount'])
            ->setParticipantsCount((int)$data['participantsCount'])
            ->setAskAddress((bool)$data['askAddress'])
            ->setAskEmail((bool)$data['askEmail'])
            ->setAskPhone((bool)$data['askPhone'])
            ->setAmINotified((bool)$data['amINotified'])
            ->setLastWriteAccess(new \DateTime($data['lastWriteAccess']));

        // Possible exception
        try {
            $lastActivity = new \DateTime($data['lastActivity']);
        } catch (\Exception $e) {
            $lastActivity = new \DateTime();
        }
        $poll->setLastActivity($lastActivity);

        // Optional, possibly missing, attributes
        if (!empty($data['adminKey'])) {
            $poll->setAdminKey($data['adminKey']);
        }
        if (!empty($data['rowConstraint'])) {
            $poll->setRowConstraint((bool)$data['rowConstraint']);
        }

        return $poll;
    }
1256490
public function create(array $data)
    {
        $data = $this->client->post(Inflector::pluralize($this->getResourceName()), [$this->getResourceName() => $data]);

        return $this->fromArray(reset($data));
    }
552260
public static function createFromData(array $data): self
    {
        if (!isset($data['method'])) {
            throw new DomainException(self::REQUIRED_METHOD);
        }

        switch ($data['method']) {
            case self::METHOD_ACCOUNT_WEIGHTS:
                $instruction = new AccountWeights($data);

                break;
            case self::METHOD_ACQUIRER_WEIGHTS:
                $instruction = new AcquirerWeights($data);

                break;
            default:
                throw new DomainException(
                    sprintf(self::UNEXPECTED_METHOD, implode(', ', self::methods()))
                );
        }

        return $instruction;
    }
257355
public function create(array &$data = null) {
		$modelClass = $this->getModelClass();

		$model = $modelClass::factory($data);
		$model->setDatagate($this);

		if ($this->hasLocator()) {
			$model->setLocator($this->getLocator());
		}

		if (empty($data)) {
			$model->forceInsert();
		}

		return $model;
	}