Get an array representation of the Card.

@return array
339210
public function toArray()
    {
        $card = str_array_filter([
            'id' => $this->id,
            'style' => $this->style,
            'format' => $this->cardFormat,
            'title' => $this->title,
            'url' => $this->url,
        ]);

        if (! str_empty($this->content)) {
            $card['description'] = [
                'value' => $this->content,
                'format' => $this->format,
            ];
        }

        if (! str_empty($this->thumbnail)) {
            $card['thumbnail'] = str_array_filter([
                'url' => $this->thumbnail,
                'url@2x' => $this->thumbnail2,
                'width' => $this->thumbnailWidth,
                'height' => $this->thumbnailHeight,
            ]);
        }

        if (! str_empty($this->activity)) {
            $card['activity'] = str_array_filter([
                'html' => $this->activity,
                'icon' => str_array_filter([
                    'url' => $this->activityIcon,
                    'url@2x' => $this->activityIcon2,
                ]),
            ]);
        }

        if (! str_empty($this->icon)) {
            $card['icon'] = str_array_filter([
                'url' => $this->icon,
                'url@2x' => $this->icon2,
            ]);
        }

        if (! empty($this->attributes)) {
            $card['attributes'] = array_map(function (CardAttribute $attribute) {
                return $attribute->toArray();
            }, $this->attributes);
        }

        return $card;
    }
813642
public function toArray()
    {
        if ($this->hasAttachment) {
            return $this->attachmentMessageToArray();
        }

        if ($this->hasText) {
            //check if has buttons
            if (count($this->buttons) > 0) {
                return $this->buttonMessageToArray();
            }

            return $this->textMessageToArray();
        }

        if (count($this->cards) > 0) {
            return $this->genericMessageToArray();
        }

        throw CouldNotCreateMessage::dataNotProvided();
    }
390268
public function getRevCardGet()
    {
        $array = array();
        if (isset($this->_receive['CardId'])) {
            $array['CardId'] = $this->_receive['CardId'];
        }
        if (isset($this->_receive['IsGiveByFriend'])) {
            $array['IsGiveByFriend'] = $this->_receive['IsGiveByFriend'];
        }
        $array['OldUserCardCode'] = $this->_receive['OldUserCardCode'];
        if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) {
            $array['UserCardCode'] = $this->_receive['UserCardCode'];
        }
        return (isset($array) && count($array) > 0) ? $array : false;
    }
447847
public function toArray()
    {
        $result = array();
        foreach ($this as $key => $entity) {
            $result[$key] = $entity->toArray();
        }
        return $result;
    }
78271
public function toArray()
    {
        return [$this->currency => [
            'name'                => $this->name,
            'code'                => $this->code,
            'precision'           => $this->precision,
            'subunit'             => $this->subunit,
            'symbol'              => $this->symbol,
            'symbol_first'        => $this->symbolFirst,
            'decimal_mark'        => $this->decimalMark,
            'thousands_separator' => $this->thousandsSeparator,
            'prefix'              => $this->getPrefix(),
            'suffix'              => $this->getSuffix(),
        ]];
    }
958465
public function getCustomerData()
    {
        $data = array(
            'disable_send_mail' => $this->getSendMail(),
            'locale'            => $this->getLocale(),
        );

        if (is_null($this->getCard())) {
            return array_filter($data);
        }

        $cardData = array(
            'address1'         => $this->getCard()->getAddress1(),
            'address2'         => $this->getCard()->getAddress2(),
            'city'              => $this->getCard()->getCity(),
            'country'           => $this->getCard()->getCountry(),
            'email'             => $this->getCard()->getEmail(),
            'first_name'        => $this->getCard()->getFirstName(),
            'house_number'      => $this->getVar1(),
            'last_name'         => $this->getCard()->getLastName(),
            'phone'             => $this->getCard()->getPhone(),
            'state'             => $this->getCard()->getState(),
            'zip_code'          => $this->getCard()->getPostcode(),
        );

        return array_filter(
            array_merge($data, $cardData)
        );
    }
1209640
public function getChildren()
    {
        $objs = $this->carddavBackend->getCards($this->addressBookInfo['id']);
        $children = [];
        foreach ($objs as $obj) {
            $obj['acl'] = $this->getChildACL();
            $children[] = new Card($this->carddavBackend, $this->addressBookInfo, $obj);
        }

        return $children;
    }
998273
public function toArray()
    {
        return [
            'id' => $this->id,
            'items' => array_map(function (CartItem $item) {
                return $item->toArray();
            }, $this->items),
        ];
    }
1187529
public function toArray()
    {
        $array = array();

        $array['orderNumber'] = $this->orderNumber;
        if (isset($this->referenceNumber)) {
            $array['referenceNumber'] = $this->referenceNumber;
        }
        if (isset($this->description)) {
            $array['description'] = $this->description;
        }
        $array['currency'] = $this->currency;
        if (isset($this->locale)) {
            $array['locale'] = $this->locale;
        }
        $array['orderDetails'] = array(
            'includeVat' => $this->vatMode,
            'products'   => array(),
        );
        if ($this->urlSet !== null) {
            $array['urlSet'] = $this->urlSet->toArray();
        }
        if ($this->contact !== null) {
            $array['orderDetails']['contact'] = $this->contact->toArray();
        }
        foreach ($this->products as $product) {
            $array['orderDetails']['products'][] = $product->toArray();
        }

        return $array;
    }
281711
public function toArray()
    {
        $result = [];

        if (!empty($this->name)) {
            $result['name'] = $this->name;
        }

        if (!empty($this->alias)) {
            $result['alias'] = $this->alias;
        }

        if (!empty($this->using)) {
            $result['using'] = $this->using->toArray();
        }

        if (!empty($this->family)) {
            $result['family'] = $this->family->toArray();
        }

        if (!empty($this->version)) {
            $result['version'] = $this->version->toArray();
        }

        if (!empty($this->type)) {
            $result['type'] = $this->type;
        }

        if (isset($result['version']) && empty($result['version'])) {
            unset($result['version']);
        }

        return $result;
    }
822576
public function toArray()
    {
        return array(
            'id' => $this->id,
            'section' => $this->section,
            'title' => $this->title,
            'description' => $this->description,
            'position' => $this->position
        );
    }
161953
public function toOptionArray() {
        return [
            [
                'value' => self::CARD_VISA,
                'label' => __('Visa')
            ],
            [
                'value' => self::CARD_MASTERCARD,
                'label' => __('Mastercard')
            ],
            [
                'value' => self::CARD_AMEX,
                'label' => __('American Express')
            ],
        ];
    }
79477
public function toArray()
    {
        $res = [];
        foreach ([
            'id',
            'displayTitle',
            'street',
            'number',
            'code',
            'town',
            'country',
            'longitude',
            'latitude',
        ] as $propertyName) {
            $res[$propertyName] = $this->{'get' . ucfirst($propertyName)}();
        }

        $res['name'] = TextUtils::truncate($this->getDisplayTitle(), 75);

        return $res;
    }
695109
public function toArray()
    {
        return [
            'name'        => $this->name,
            'title'       => $this->title,
            'url'         => $this->url,
            'icon'        => $this->icon,
            'active'      => $this->isActive(),
            'children'    => $this->children->toArray(),
            'roles'       => $this->roles,
            'permissions' => $this->permissions,
        ];
    }
422041
public function getSlotsAsArray() {
		$slots = [];
		if(!is_array($this->getSlots())) {
			return $slots;
		}

		foreach($this->getSlots() as $key => $slot) {
			$slots[$key] = $slot->getValue();
		}

		return $slots;
	}
711844
protected function getCardData()
    {
        $data = array();
        $card = $this->getCard();
        if (!empty($card)) {
            if ($card->getExpiryMonth()) {
                $data['exp_month'] = $card->getExpiryMonth();
            }
            if ($card->getExpiryYear()) {
                $data['exp_year'] = $card->getExpiryYear();
            }
            if ($card->getName()) {
                $data['name'] = $card->getName();
            }
            if ($card->getNumber()) {
                $data['number'] = $card->getNumber();
            }
            if ($card->getAddress1()) {
                $data['address_line1'] = $card->getAddress1();
            }
            if ($card->getAddress2()) {
                $data['address_line2'] = $card->getAddress2();
            }
            if ($card->getCity()) {
                $data['address_city'] = $card->getCity();
            }
            if ($card->getPostcode()) {
                $data['address_zip'] = $card->getPostcode();
            }
            if ($card->getState()) {
                $data['address_state'] = $card->getState();
            }
            if ($card->getCountry()) {
                $data['address_country'] = $card->getCountry();
            }
        }

        return $data;
    }
23882
public function asArray()
    {
        return [
            'id'        => $this->getId(),
            'className' => $this->getClassName(),
            'instance'  => $this->getInstance(),
            'arguments' => $this->getArguments(),
            'type'      => $this->getType(),
            'target'    => $this->getTarget(),
            'position'  => $this->getPosition(),
        ];
    }