isGood example

// Sort all line items by their price definition priority         krsort($lineItemsByPricePriority);

        if (\count($lineItemsByPricePriority)) {
            $this->elements = array_merge(...$lineItemsByPricePriority);
        }
    }

    public function filterGoods(): self
    {
        return $this->filter(
            fn (LineItem $lineItem) => $lineItem->isGood()
        );
    }

    /** * @return LineItem[] */
    public function filterGoodsFlat(): array
    {
        $lineItems = $this->getFlat();

        $filtered = [];
        
$data = [
            'id' => $id,
            'identifier' => $lineItem->getId(),
            'productId' => $productId,
            'promotionId' => $promotionId,
            'referencedId' => $lineItem->getReferencedId(),
            'quantity' => $lineItem->getQuantity(),
            'type' => $lineItem->getType(),
            'label' => $lineItem->getLabel(),
            'description' => $lineItem->getDescription(),
            'good' => $lineItem->isGood(),
            'removable' => $lineItem->isRemovable(),
            'stackable' => $lineItem->isStackable(),
            'position' => $position,
            'price' => $lineItem->getPrice(),
            'priceDefinition' => $definition,
            'parentId' => $parentId,
            'coverId' => $lineItem->getCover() ? $lineItem->getCover()->getId() : null,
            'payload' => $lineItem->getPayload(),
            'states' => $lineItem->getStates(),
        ];

        
Home | Imprint | This part of the site doesn't use cookies.