Create a new order expression.

@param  array $data Optional expression data.
@return DatabaseOrder
766457
protected function createOrder(array $data = null)
    {
        $order = new DatabaseOrder();
        if ($data !== null) {
            $order->setData($data);
        }
        return $order;
    }
884407
public static function createFromData(array $data)
    {
        if (!isset($data['formula'])) {
            throw new DomainException(self::REQUIRED_FORMULA);
        }

        switch ($data['formula']) {
            case self::FLAT_RATE:
                return new Pricing\FlatRate($data);
            case self::FIXED_FEE:
                return new Pricing\FixedFee($data);
            case self::STAIRSTEP:
                return new Pricing\Stairstep($data);
            case self::TIERED:
                return new Pricing\Tiered($data);
            case self::VOLUME:
                return new Pricing\Volume($data);
            default:
                throw new DomainException(sprintf(self::UNSUPPORTED_FORMULA, implode(',', self::getAvailableFormulas())));
        }
    }
772316
public function createRecord($data)
    {
        $this->primeCommandArray();
        $this->addToCommandArray($data);
        $this->addToCommandArray(['-new' => null]);
        return $this;
    }
432235
public function createFor(Order $order, array $data, array $filters = [])
    {
        return $this->createForId($order->id, $data, $filters);
    }
646519
public function create(array $data)
    {
        $response = $this->ontraport->post(
            $this->getNamespace(), $this->toArray($data)
        );

        return $this->ontraport->item($this, $response);
    }
566606
protected function createPagination(array $data = null)
    {
        $pagination = new DatabasePagination();
        if ($data !== null) {
            $pagination->setData($data);
        }
        return $pagination;
    }
1291302
public function create(array $data = [])
	{
		$created = $this->model->create($data);

		if( ! $created)
		{
			return new Payload(null, 'not_created');
		}

		// Cache the newly created model and tag it with table's name.
		Cache::tags($this->model->getTable())->forever($created->getKey(), $created);

		return new Payload($created, 'created');
	}
1035062
public static function createFromData(array $data)
    {
        if (!isset($data['type'])) {
            throw new DomainException(self::MSG_REQUIRED_TYPE);
        }

        switch ($data['type']) {
            case self::TYPE_DISCOUNTS_PER_REDEMPTION:
                $restriction = new Restrictions\DiscountsPerRedemption($data);

                break;
            case self::TYPE_REDEMPTIONS_PER_CUSTOMER:
                $restriction = new Restrictions\RedemptionsPerCustomer($data);

                break;
            case self::TYPE_RESTRICT_TO_INVOICES:
                $restriction = new Restrictions\RestrictToInvoices($data);

                break;
            case self::TYPE_RESTRICT_TO_PLANS:
                $restriction = new Restrictions\RestrictToPlans($data);

                break;
            case self::TYPE_RESTRICT_TO_SUBSCRIPTIONS:
                $restriction = new Restrictions\RestrictToSubscriptions($data);

                break;
            case self::TYPE_TOTAL_REDEMPTIONS:
                $restriction = new Restrictions\TotalRedemptions($data);

                break;
            case self::TYPE_MINIMUM_ORDER_AMOUNT:
                $restriction = new Restrictions\MinimumOrderAmount($data);

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

        return $restriction;
    }
1296036
protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            'token' => $this->userRepository->createToken(),
            'active' => 1,
        ]);
    }
845427
public function create(array $data) : Model
    {
        $model_class = $this->getModelName();
        return $this->postCreate($data, $model_class::create($this->preCreate($this->parseData($data))));
    }
493043
protected function createFilter(array $data = null)
    {
        $filter = new static();
        if ($data !== null) {
            $filter->setData($data);
        }
        return $filter;
    }
1167415
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['assets'])) {
            $self->setAssets($data['assets']);
        }
        if (isset($data['locales'])) {
            $self->setLocales($data['locales']);
        }

        return $self;
    }
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);
    }
71936
public function create(array $data)
    {
        $response = $this->httpPost('/3/invoices', ['Invoice' => $data]);

        if (!$this->hydrator) {
            return $response;
        }

        // Use any valid status code here
        if (201 !== $response->getStatusCode()) {
            $this->handleErrors($response);
        }

        return $this->hydrator->hydrate($response, Model::class);
    }
541707
public static function createFromData(array $data)
    {
        if (!isset($data['method'])) {
            throw new DomainException(self::REQUIRED_METHOD);
        }

        switch ($data['method']) {
            case self::AUTO:
                $scheduleInstruction = new AutoType($data);

                break;
            case self::DATE_INTERVAL:
                $scheduleInstruction = new DateIntervalType($data);

                break;
            case self::DAY_OF_MONTH:
                $scheduleInstruction = new DayOfMonthType($data);

                break;
            case self::DAY_OF_WEEK:
                $scheduleInstruction = new DayOfWeekType($data);

                break;
            case self::IMMEDIATELY:
                $scheduleInstruction = new ImmediatelyType($data);

                break;
            case self::INTELLIGENT:
                $scheduleInstruction = new IntelligentType($data);

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

        return $scheduleInstruction;
    }
321048
public function create(array $data = [])
    {
        $collection = parent::create($data);

        if ($this->getCurrentCategory() && $this->getCurrentCategory()->getLevel() >= 2) {
            $collection->addAttributeToFilter('entity_id', ['neq' => (int) $this->getCurrentCategory()->getId()]);

            $rootPath      = array_slice($this->getCurrentCategory()->getPathIds(), 0, 2);
            $pathCondition = implode('/', $rootPath) . '%';
            $collection->addFieldToFilter('path', ['like' => $pathCondition]);
        }

        return $collection;
    }
478995
public static function create(array $data = [])
    {
        if (isset($data[0]) && is_array($data[0])) {

            $collection = new Collection();

            foreach ($data as $row) {
                /** @var ORM $obj */
                $class = get_called_class();
                $obj = new $class();
                $obj->setState($row);
                $obj->save();

                $collection->add($obj);
            }

            return $collection;
        }

        /** @var ORM $obj */
        $class = get_called_class();
        $obj = new $class();
        $obj->setState($data);
        $obj->save();

        return $obj;
    }