Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- zuvor:
- public function jsonSerialize()
- {
- $virtual = [
- 'bAktiv' => $this->{"bAktiv"}
- ];
- $override = [
- 'cName' => $this->getName(),
- 'kArtikel' => $this->getArtikelKey(),
- 'cBeschreibung' => !empty($this->getKurzBeschreibung())
- ? $this->getKurzBeschreibung()
- : $this->getBeschreibung(),
- 'bAnzahl' => $this->getMin() != $this->getMax(),
- 'fInitial' => (float) $this->getInitial(),
- 'fMin' => (float) $this->getMin(),
- 'fMax' => (float) $this->getMax(),
- 'cBildPfad' => $this->getBildPfad(),
- 'fPreis' => [
- (float) $this->getPreis(),
- (float) $this->getPreis(true)
- ],
- 'fPreisLocalized' => [
- gibPreisStringLocalized($this->getPreis()),
- gibPreisStringLocalized($this->getPreis(true))
- ]
- ];
- $result = array_merge($override, $virtual);
- return utf8_convert_recursive($result);
- }
- neu:
- public function jsonSerialize()
- {
- $cKurzBeschreibung = $this->getKurzBeschreibung();
- $virtual = [
- 'bAktiv' => $this->{"bAktiv"}
- ];
- $override = [
- 'cName' => $this->getName(),
- 'kArtikel' => $this->getArtikelKey(),
- 'cBeschreibung' => !empty($cKurzBeschreibung)
- ? $this->getKurzBeschreibung()
- : $this->getBeschreibung(),
- 'bAnzahl' => $this->getMin() != $this->getMax(),
- 'fInitial' => (float) $this->getInitial(),
- 'fMin' => (float) $this->getMin(),
- 'fMax' => (float) $this->getMax(),
- 'cBildPfad' => $this->getBildPfad(),
- 'fPreis' => [
- (float) $this->getPreis(),
- (float) $this->getPreis(true)
- ],
- 'fPreisLocalized' => [
- gibPreisStringLocalized($this->getPreis()),
- gibPreisStringLocalized($this->getPreis(true))
- ]
- ];
- $result = array_merge($override, $virtual);
- return utf8_convert_recursive($result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement