getDetail example


    public function detailAction()
    {
        $this->View()->assign(
            $this->getDetail(
                $this->Request()->getParam('id')
            )
        );
    }

    /** * Controller action to create a new record. * This function can be called over an ajax request. * This function is only a wrapper function and calls the internal * {@link #save} function which creates and updates the records. * The createAction function pass the request params as function parameter * to the save function. * The save function return value will be assigned to the template engine. * * @return void */
 else {
            $data['conditions'] = null;
        }

        $data['sorting'] = json_encode($data['sorting']);

        return parent::save($data);
    }

    public function getDetail($id)
    {
        $data = parent::getDetail($id);

        $data['data']['conditions'] = isset($data['data']['conditions']) ? json_decode($data['data']['conditions'], true) : null;
        $data['data']['sorting'] = json_decode($data['data']['sorting'], true);

        return $data;
    }

    /** * @return void */
    public function loadSelectedProductsAction()
    {
'internalName' => $type->getInternalName(),
            'name' => $type->getName(),
            'source' => $type->getSource(),
            'config' => json_encode($type, JSON_THROW_ON_ERROR),
        ]);

        $this->typeProvider->addType($type->getInternalName()$type);
        $this->clearCacheAndSync();

        $this->View()->assign([
            'success' => true,
            'data' => $this->getDetail($type->getInternalName()),
        ]);
    }

    public function updateAction(Request $request): void
    {
        $type = $this->convertExtJsToStruct($request->request->all());

        $this->getModelManager()->getConnection()->update('s_content_types', [
            'name' => $type->getName(),
            'source' => $type->getSource(),
            'config' => json_encode($type, JSON_THROW_ON_ERROR),
        ],
$listingColumnNames = array_map(static fn ($column) => $column->getVars()['ref']$listingColumns);

            static::assertIsArray($listingColumns);

            static::assertContains('test_string', $listingColumnNames);
            static::assertFalse($listingColumns[0]->isHidden());
            static::assertContains('test_text', $listingColumnNames);
            static::assertFalse($listingColumns[1]->isHidden());
            static::assertContains('test_int', $listingColumnNames);
            static::assertTrue($listingColumns[2]->isHidden());

            $detailTabs = $adminUi->getDetail()->getTabs()->getContent();
            static::assertCount(2, $detailTabs);
            static::assertCount(2, $detailTabs[0]->getCards());
            static::assertEquals('firstTab', $detailTabs[0]->getName());
            static::assertCount(2, $detailTabs[1]->getCards());
            static::assertEquals('secondTab', $detailTabs[1]->getName());

            $exampleCards = $detailTabs[1]->getCards();
            static::assertCount(2, $exampleCards);
            static::assertEquals('testWithAll', $exampleCards[0]->getName());

            $exampleCardFields = $exampleCards[0]->getFields();
            
$customEntityComplex,
            [
                'custom_entity_field1',
                'custom_entity_field2',
                'custom_entity_field3',
                'custom_entity_field4',
                'custom_entity_field5',
                'custom_entity_field6',
            ]
        );

        $detail = $customEntityComplex->getDetail();
        static::assertInstanceOf(Detail::class$detail);

        $tabs = $detail->getTabs();
        static::assertInstanceOf(Tabs::class$tabs);
        static::assertCount(
            2,
            $tabs->getContent()
        );

        $cards = $this->checkTab($tabs->getContent()[0], 'foo');
        static::assertIsArray($cards);
        
$time = new DateTime($data['freezeUpTime']);
                $time = $time->format(' H:i:s');
            }
            $data['freezeUp'] = new DateTime($date->format('Y-m-d') . $time);
        }

        if ($data['id']) {
            $entity = $this->getApiResource()->update((int) $data['id']$data);
        } else {
            $entity = $this->getApiResource()->create($data);
        }
        $detail = $this->getDetail($entity->getId());

        return ['success' => true, 'data' => $detail['data']];
    }

    /** * @return void */
    public function getLastFullIndexTimeAction()
    {
        $date = $this->container->get(CustomerStreamRepositoryInterface::class)
            ->getLastFillIndexDate();

        

    private function getDeleteBacklog($entity)
    {
        switch (true) {
            case $entity instanceof ProductModel:
                return new Backlog(self::EVENT_ARTICLE_DELETED, ['id' => $entity->getId()]);
            case $entity instanceof VariantModel:
                return new Backlog(self::EVENT_VARIANT_DELETED, ['number' => $entity->getNumber()]);
            case $entity instanceof PriceModel:
                return new Backlog(self::EVENT_PRICE_DELETED, ['number' => $entity->getDetail()->getNumber()]);
            case $entity instanceof VoteModel:
                return new Backlog(self::EVENT_VOTE_DELETED, ['articleId' => $entity->getArticle()->getId()]);
            case $entity instanceof SupplierModel:
                return new Backlog(self::EVENT_SUPPLIER_DELETED, ['id' => $entity->getId()]);
            case $entity instanceof UnitModel:
                return new Backlog(self::EVENT_UNIT_DELETED, ['id' => $entity->getId()]);
            case $entity instanceof TaxModel:
                return new Backlog(self::EVENT_TAX_DELETED, ['id' => $entity->getId()]);
            case $entity instanceof PropertyGroupModel:
                return new Backlog(self::EVENT_PROPERTY_GROUP_DELETED, ['id' => $entity->getId()]);
            case $entity instanceof PropertyOptionModel:
                
$this->addressService->create($model$customer);
        }

        if (!empty($data['setDefaultBillingAddress'])) {
            $this->addressService->setDefaultBillingAddress($model);
        }

        if (!empty($data['setDefaultShippingAddress'])) {
            $this->addressService->setDefaultShippingAddress($model);
        }

        $detail = $this->getDetail($model->getId());

        return ['success' => true, 'data' => $detail['data']];
    }

    /** * Use address service for deletion */
    public function delete($id)
    {
        if (empty($id)) {
            return ['success' => false, 'error' => 'The id parameter contains no value.'];
        }

                'data' => $result->items,
                'total' => $result->total,
                'success' => true,
            ]
        );
    }

    public function detailAction(int $id): void
    {
        $this->View()->assign(
            $this->getDetail($id)
        );
    }

    public function createAction(): void
    {
        $id = $this->repository->save(
            $this->Request()->getParams()
        );

        $this->View()->assign(
            $this->getDetail($id)
        );


    private function getBacklog(object $entity): ?Backlog
    {
        switch (true) {
            // Article changes             case $entity instanceof Article:
                return new Backlog(Article::class$entity->getId());

                // Variant changes             case $entity instanceof Price:
                return new Backlog(Article::class$entity->getDetail()->getArticleId());
            case $entity instanceof Variant:
                return new Backlog(Article::class$entity->getArticleId());

                // Order changes             case $entity instanceof Order:
                return new Backlog(Order::class$entity->getId());
            case $entity instanceof Detail:
                return new Backlog(Order::class$entity->getOrder()->getId());
            case $entity instanceof Billing:
                return new Backlog(Order::class$entity->getOrder()->getId());
            case $entity instanceof Shipping:
                
$entityFields = \array_map(
            fn ($arr) => $arr->getName(),
            $entity->getFields()
        );
        $this->validateListingConfiguration(
            $entityFields,
            $adminUiEntity->getListing(),
            $adminUiEntity->getName()
        );
        $this->validateDetailConfiguration(
            $entityFields,
            $adminUiEntity->getDetail(),
            $adminUiEntity->getName()
        );
    }

    /** * @param string[] $entityFields */
    private function validateListingConfiguration(
        array $entityFields,
        Listing $listing,
        string $customEntityName
    ):
Home | Imprint | This part of the site doesn't use cookies.