name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getDefaultFormula(): PriceFormula { return $this->PriceFormulaDefault; } public function setDefaultFormula(PriceFormula $PriceFormula): self { $this->PriceFormulaDefault = $PriceFormula; return $this; } /** * @return PriceFormula[]|array */ public function getExtendedFormulas(): array { return $this->PriceFormulasExtended; } /** * @param PriceFormula[]|array $PriceFormulas * @return $this */ public function setExtendedFormulas(array $PriceFormulas): self { $this->PriceFormulasExtended = $PriceFormulas; return $this; } public function getCents(): int { return $this->cents; } public function setCents(int $cents): self { $this->cents = $cents; return $this; } public function getComparedCents(): int { return $this->comparedCents; } public function setComparedCents(int $comparedCents): self { $this->comparedCents = $comparedCents; return $this; } public function getUseExtendedPriceMarkup(): bool { return $this->useExtendedPriceMarkup; } public function setUseExtendedPriceMarkup(bool $useExtendedPriceMarkup): self { $this->useExtendedPriceMarkup = $useExtendedPriceMarkup; return $this; } public function getUseComparedPriceMarkup(): bool { return $this->useComparedPriceMarkup; } public function setUseComparedPriceMarkup(bool $useComparedPriceMarkup): self { $this->useComparedPriceMarkup = $useComparedPriceMarkup; return $this; } public function getAddShippingToPrice(): bool { return $this->addShippingToPrice; } public function setAddShippingToPrice(bool $addShippingToPrice): self { $this->addShippingToPrice = $addShippingToPrice; return $this; } public function getApplyPriceRulesAfterShippingCost(): bool { return $this->applyPriceRulesAfterShippingCost; } public function setApplyPriceRulesAfterShippingCost(bool $applyPriceRulesAfterShippingCost): self { $this->applyPriceRulesAfterShippingCost = $applyPriceRulesAfterShippingCost; return $this; } public function getPricingRulesType(): string { return $this->pricingRulesType; } public function setPricingRulesType(string $pricingRulesType): self { $this->pricingRulesType = $pricingRulesType; return $this; } public function toArray(): array { $extendedFormulas = []; foreach ($this->getExtendedFormulas() as $PriceFormula) { $extendedFormulas[] = $PriceFormula->toArray(); } return [ self::NAME_FIELD => $this->getName(), self::DEFAULT_FORMULA_FIELD => $this->getDefaultFormula()->toArray(), self::FORMULA_LIST_FIELD => $extendedFormulas, self::PRICE_CENTS_FIELD => $this->getCents(), self::PRICE_COMPARED_CENTS_FIELD => $this->getComparedCents(), self::USE_EXTENDED_PRICE_MARKUP_FIELD => $this->getUseExtendedPriceMarkup(), self::USE_COMPARED_PRICE_MARKUP_FIELD => $this->getUseComparedPriceMarkup(), self::ADD_SHIPPING_TO_PRICE_FIELD => $this->getAddShippingToPrice(), self::APPLY_PRICE_RULES_AFTER_SHIPPING_COST_FIELD => $this->getApplyPriceRulesAfterShippingCost(), self::PRICING_RULES_TYPE_FIELD => $this->getPricingRulesType(), ]; } }