Create item

@return mixed
324128
protected function __apiStore ()
    {
        $data = $this->getInputData ();

        $record = HCAppsTokens::create (array_get ($data, 'record'));

        return $this->apiShow ($record->id);
    }
1078663
public function create()
    {
        $instance = self::createOrderLineItem($this);
        $this->setId($instance->getId());
        return $instance;
    }
36183
public function create()
    {
        // Create Response Model
        $response = new ResponseModel();

        // return response
        $response->setData(collect($this->model->getFillable()));
        $response->setMessage($this->getTrans('create', 'successful'));
        return SmartResponse::response($response);
    }
526187
public function getItem()
    {
        $bib = Bib::make($this->client, $this->data->bib_data->mms_id);
        $holding = Holding::make($this->client, $bib, $this->data->holding_data->holding_id);

        return Item::make(
            $this->client,
            $bib,
            $holding,
            $this->data->item_data->pid
        )->init($this->data->item_data);
    }
1157344
public function actionCreate()
    {
        /* @var $model ActiveRecord */
        $model = $this->createModel();
        $model->load(Yii::$app->request->post(), '');
        $model->save();

        return $model;
    }
1151790
public function create()
    {
        // Look for overriden views
        $this->overrideViews();

        // Pass validation through
        Former::withRules($this->getRules());

        // Initialize localization
        with($localize = new Localize)
            ->model($this->model)
            ->title(Str::singular($this->title));

        // Make the sidebar
        $sidebar = new Sidebar;
        if (!$localize->hidden()) {
            $sidebar->addToEnd($localize);
        }

        // Render view
        return $this->populateView($this->show_view, [
            'item' => null,
            'localize' => $localize,
            'sidebar' => $sidebar,
            'parent_id' => $this->parent ? $this->parent->getKey() : null,
        ]);
    }
135655
public function create()
    {
        /**
         * @var Order $order
         */
        $classNamespace = $this->getEntityNamespace();
        $order = new $classNamespace();
        $order
            ->setQuantity(0)
            ->setWidth(0)
            ->setHeight(0)
            ->setWidth(0)
            ->setWeight(0)
            ->setCreatedAt($this->now())
            ->setPurchasableAmount($this->createZeroAmountMoney())
            ->setAmount($this->createZeroAmountMoney())
            ->setCouponAmount($this->createZeroAmountMoney())
            ->setShippingAmount($this->createZeroAmountMoney());

        $paymentStateLineStack = $this
            ->paymentMachineManager
            ->initialize(
                $order,
                StateLineStack::create(
                    new ArrayCollection(),
                    null
                ),
                'Order not paid'
            );

        $order->setPaymentStateLineStack($paymentStateLineStack);

        $shippingStateLineStack = $this
            ->shippingMachineManager
            ->initialize(
                $order,
                StateLineStack::create(
                    new ArrayCollection(),
                    null
                ),
                'Preparing Order'
            );

        $order->setShippingStateLineStack($shippingStateLineStack);

        return $order;
    }
898284
public function create()
    {
        $syncLevel = $this->scopeConfig->getValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_CATALOG_VALUES
        );

        if ($syncLevel == self::SYNC_CATALOG_DEFAULT_LEVEL) {
            return $this->defaultLevelCatalogSyncerFactory->create();
        } elseif ($syncLevel == self::SYNC_CATALOG_STORE_LEVEL) {
            return $this->storeLevelCatalogSyncerFactory->create();
        }

        return null;
    }
374263
public function create()
    {
        $instance = self::createFreeShippingPromotion($this);
        $this->setId($instance->getId());
        return $instance;
    }
1152270
public function create()
    {
        $instance = self::createFreeShippingCoupon($this);
        $this->setId($instance->getId());
        return $instance;
    }
720008
public function create()
    {
        $instance = self::createDiscountCoupon($this);
        $this->setId($instance->getId());
        return $instance;
    }
1091041
public function createAction()
    {
        $this->checkAuth(AdminResources::PRODUCT, [], AccessManager::CREATE);

        $baseForm = $this->createForm(ApiForm::PRODUCT_SALE_ELEMENTS, "form", [], [
            "validation_groups" => ["create", "Default"],
            'csrf_protection' => false,
            "cascade_validation" => true,
        ]);

        $con = Propel::getConnection(ProductSaleElementsTableMap::DATABASE_NAME);
        $con->beginTransaction();

        $createdIds = array();

        try {
            $form = $this->validateForm($baseForm);

            $entries = $form->getData();

            foreach ($entries["pse"] as $entry) {
                $createEvent = new ProductSaleElementCreateEvent(
                    ProductQuery::create()->findPk($entry["product_id"]),
                    $entry["attribute_av"],
                    $entry["currency_id"]
                );

                $createEvent->bindForm($form);

                $this->dispatch(TheliaEvents::PRODUCT_ADD_PRODUCT_SALE_ELEMENT, $createEvent);

                $this->processUpdateAction(
                    $entry,
                    $pse = $createEvent->getProductSaleElement(),
                    $createEvent->getProduct()
                );

                $createdIds[] = $pse->getId();
            }

            $con->commit();
        } catch (\Exception $e) {
            $con->rollBack();

            return new JsonResponse(["error" => $e->getMessage()], 500);
        }

        return new JsonResponse(
            $this->getProductSaleElements(
                array_merge(
                    $this->getRequest()->query->all(),
                    ["id" => implode(",", $createdIds)]
                )
            ),
            201
        );
    }
671892
public function create()
    {
        $instance = self::createReturnLineItem($this);
        $this->setId($instance->getId());
        return $instance;
    }
1182985
public function create()
    {
      $data = Ensure::Input(func_get_args());
      $url = URIResource::Make($this->path);
      $id = Locator::Find($this->client->post($url, $data->get()));
      $data->add("id", $id);

      return Constructor::Make($this, $data->get(), TRUE);
    }
981045
public function actionCreate()
    {
        $model = new AuthItemModel();
        $model->type = $this->type;

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('yii2mod.rbac', 'Item has been saved.'));

            return $this->redirect(['view', 'id' => $model->name]);
        }

        return $this->render('create', ['model' => $model]);
    }
260644
public function create()
    {
        $instance = self::createBrand($this);
        $this->setId($instance->getId());
        return $instance;
    }
1222894
public function create()
    {
        $instance = self::createWishList($this);
        $this->setId($instance->getId());
        return $instance;
    }