Retrieve data to populate the beacon email form

@return array
179368
private function get_identify() {
		$products = $this->get_products( $this->current_page );
		$cache_key = $this->get_cache_key( $products );

		$identify_data = get_transient( $cache_key );
		if ( ! $identify_data ) {
			$identifier = new Yoast_HelpScout_Beacon_Identifier( $this->get_products( $this->current_page ) );
			$identify_data = $identifier->get_data();

			if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
				set_transient( $cache_key, $identify_data, DAY_IN_SECONDS );
			}
		}

		return $identify_data;
	}
738012
public function toArray()
	{
		return [
			'name' => (string) $this->name,
			'email' => SerializationHelper::serialize($this->email),
			'links' => SerializationHelper::serialize($this->links)
		];
	}
1198589
protected function get_data_to_serialize() {
		return array(
			'recipient'    => $this->recipient->ID,
			'message'      => $this->message,
			'subject'      => $this->subject,
			'strategy'     => $this->strategy,
			'manager'      => $this->manager->get_type(),
			'data_sources' => $this->data_sources
		);
	}
803260
public function getData()
    {
        $result = [
            'type' => $this->type,
        ];

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

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

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

            foreach ($this->buttons as $btn) {
                $result['buttons'][] = $btn->getData();
            }
        }

        return $result;
    }
784242
public function getMessages()
    {
        $message = new IncomingMessage(Location::PATTERN, $this->event->get('ToUserName'), $this->event->get('FromUserName'),
            $this->event);
        $message->setLocation($this->getLocation());

        return [$message];
    }
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)
        );
    }
1296472
public function retrieveAll()
    {
        if (empty($this->forms)) {
            $data        = $this->getModel()->get();
            $this->forms = $this->processRetrievedData($data);
        }
        return $this->forms;
    }
228465
public function getEmails()
    {
        $entities = [];
        if ($this->entity->getEmails()) {
            foreach ($this->entity->getEmails() as $email) {
                $entities[] = $email;
            }
        }

        return $entities;
    }
1023875
protected function getPaymentData()
    {
        $data = array(
            'cancel_url'   => $this->getCancelUrl(),
            'close_window' => $this->getCloseWindow(),
            'notification_url' => $this->getNotifyUrl(),
            'redirect_url'   => $this->getReturnUrl(),
        );

        return array_filter($data);
    }
1046179
public function email()
    {
        $this->debug->groupCollapsed(__METHOD__);
        $cfg = $this->form->cfg;
        // $persist = &$this->persist;
        $this->emailHeaders = $cfg['email']['headers'];
        $this->debug->log('emailHeaders', $this->emailHeaders);
        $emailBody = '';
        $this->collected = array(
            'email' => '',
            'name'  => '',
        );
        $dbWas = $this->debug->log('collect', false);
        $pages = $this->form->persist->get('pages');
        foreach ($pages as $i => $page) {
            $this->form->setCurrentFields($i);
            if (\count($pages) > 1) {
                $emailBody .= '*** '.\str_replace('_', ' ', $page['name']).' ***'."\n\n";
            }
            $emailBody .= $this->emailGetPage();
        }
        $this->debug->log('collect', $dbWas);
        if (!$cfg['email']['inclMetaInfo']) {
            $emailBody = $this->emailGetMetaInfo()."\n"
                .$emailBody;
        }
        $this->emailHeaders['Body'] = $emailBody;
        if (empty($this->emailHeaders['Reply-To']) && !empty($this->collected['email'])) {
            $this->emailHeaders['Reply-To'] = $this->collected['name'].'<'.$this->collected['email'].'>';
        }
        $email = new Email();
        $return = $email->send($this->emailHeaders);
        $this->debug->groupEnd();
        return $return;
    }
836644
public function getTo()
    {
        $recipients = [];
        foreach ($this->message->getTo() as $email => $name) {
            $recipients[] = new Email($email, $name);
        }

        return $recipients;
    }
545029
public function getData()
    {
        $this->setDefaults();

        $this->validate(
            'partner',
            '_input_charset',
            'refund_date',
            'batch_no',
            'refund_items'
        );

        $this->validateOne(
            'seller_user_id',
            'seller_email'
        );

        $this->setBatchNum(count($this->getRefundItems()));
        $this->setRefundDetail($this->getDetailData());

        $data = [
            'service'        => $this->service,
            'partner'        => $this->getPartner(),
            'notify_url'     => $this->getNotifyUrl(),
            'seller_user_id' => $this->getPartner(),
            'refund_date'    => $this->getRefundDate(),
            'batch_no'       => $this->getBatchNo(),
            'batch_num'      => $this->getBatchNum(),
            'detail_data'    => $this->getDetailData(),
            '_input_charset' => $this->getInputCharset(),
        ];

        $data['sign'] = $this->sign($data, $this->getSignType());
        $data['sign_type'] = $this->getSignType();

        return $data;
    }
979368
public function getData()
    {
        if (empty($this->data)) {
            $this->data = [
                'entityClassName' => $this->getEntityClassName(),
                'entityName' => $this->getEntityName(),
                'formFilename' => lcfirst($this->getEntityName()).'-form'
            ];
        }
        return $this->data;
    }
445392
public function get()
    {
        $notifications = $this->stack->getNotifications()->get();
        $alerts        = $this->stack->getAlerts()->get();
        $count         = $this->stack->getCount();
        $return        = [
            'notifications' => [
                'items' => $this->decorator->decorate($notifications),
                'count' => array_get($count, 'notifications', 0),
            ],
            'alerts'        => [
                'items' => $this->decorator->decorate($alerts, 'alert'),
                'count' => array_get($count, 'alerts', 0)
            ],
        ];
        return new JsonResponse($return, 200);
    }
1110096
public function getData()
    {

        $result = [
            'attachment' => [
                'type' => 'template',
                'payload' => [
                    'template_type' => $this->type
                ]
            ]
        ];

        if (is_array($this->quick_replies)) {
            foreach ($this->quick_replies as $qr) {
                if ($qr instanceof QuickReplyButton) {
                    $result['quick_replies'][] = $qr->getData();
                }
            }
        }

        switch ($this->type)
        {
            case self::TYPE_BUTTON:
                $result['attachment']['payload']['text'] = $this->title;
                $result['attachment']['payload']['buttons'] = [];

                foreach ($this->buttons as $btn) {
                    $result['attachment']['payload']['buttons'][] = $btn->getData();
                }

            break;

            case self::TYPE_GENERIC:
                $result['attachment']['payload']['elements'] = [];
                $result['attachment']['payload']['image_aspect_ratio'] = $this->image_aspect_ratio;

                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }
            break;

            case self::TYPE_LIST:
                $result['attachment']['payload']['elements'] = [];
                $result['attachment']['payload']['top_element_style'] = $this->top_element_style;
                //list items button
                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }
                //the whole list button
                foreach ($this->buttons as $btn) {
                    $result['attachment']['payload']['buttons'][] = $btn->getData();
                }
            break;

            case self::TYPE_RECEIPT:
                $result['attachment']['payload']['recipient_name'] = $this->recipient_name;
                $result['attachment']['payload']['order_number'] = $this->order_number;
                $result['attachment']['payload']['currency'] = $this->currency;
                $result['attachment']['payload']['payment_method'] = $this->payment_method;
                $result['attachment']['payload']['order_url'] = $this->order_url;
                $result['attachment']['payload']['timestamp'] = $this->timestamp;
                $result['attachment']['payload']['elements'] = [];

                foreach ($this->elements as $btn) {
                    $result['attachment']['payload']['elements'][] = $btn->getData();
                }

                $result['attachment']['payload']['address'] = $this->address->getData();
                $result['attachment']['payload']['summary'] = $this->summary->getData();
                $result['attachment']['payload']['adjustments'] = [];

                foreach ($this->adjustments as $btn) {
                    $result['attachment']['payload']['adjustments'][] = $btn->getData();
                }
            break;
        }


        if ($this->recipient) {
            return [
                'recipient' =>  [
                    'id' => $this->recipient
                ],
                'message' => $result,
                'tag' => $this->tag,
                'notification_type'=> $this->notification_type,
                'messaging_type' => $this->messaging_type
            ];
        } else {
            //share_contents only
            return [
                'attachment' => $result['attachment']
            ];
        }
    }
186900
public function getNotificationTemplateData()
    {
        $fields = $this->Context->getValues();
        if (!is_array($fields)) {
            $fields = [];
        }
        $fields['Content'] = $this->Content;
        return $fields;
    }
705092
public function getUsersList() {
        $response=CodeBank_ClientAPI::responseBase();
        
        $members=Permission::get_members_by_permission(array('ADMIN', 'CODE_BANK_ACCESS'));
        foreach($members as $member) {
            $response['data'][]=array(
                                    'id'=>$member->ID,
                                    'username'=>$member->Email,
                                    'lastLogin'=>$member->LastVisited
                                );
        }
        
        
        return $response;
    }