@return array
@throws Exception

API documentation: https://whatcounts.zendesk.com/hc/en-us/articles/203969549
328369
public function getSocialProviders()
		{
			$xml = $this->call('getsocialproviders');

			$social_providers = array();

			foreach ($xml->Data as $social_provider_item) {
				$social_provider = new SocialProvider;
				$social_provider
					->setProviderId((int)$social_provider_item->social_provider_id)
					->setProviderName((string)$social_provider_item->provider)
					->setUsername((string)$social_provider_item->username);
				$social_providers[] = $social_provider;
			}

			return $social_providers;
		}
957952
public function getColumnsList()
    {
        //check whether workshett name is set or not
        if ($this->worksheetName == '')
            throw new Exception('Worksheet name not specified');
        $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
            '/worksheets/' . $this->worksheetName . '/cells/columns';
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        $listColumns = array();
        foreach ($json->Columns->ColumnsList as $column) {
            $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
                '/worksheets/' . $this->worksheetName . '/cells/columns' . $column->link->Href;
            $signedURI = Utils::sign($strURI);
            $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
            $json = json_decode($responseStream);
            array_push($listColumns, $json->Column);
        }

        return $listColumns;

    }
39868
public function getData()
    {
        $data = [];

        $problems = $this->fetcher->fetch();

        $allowedSeverities = [
            Problem::SEVERITY_CRITICAL,
            Problem::SEVERITY_WARNING,
        ];

        foreach ($problems as $problem) {
            if (!in_array($problem->getSeverity(), $allowedSeverities)) {
                continue;
            }

            $data[] = [
                'id' => strlen($problem->getId()) ? $problem->getId() : md5(serialize($problem)),
                'iconCls' => $problem->getIconClass(),
                'severity' => $problem->getSeverity(),
                'msg' => $problem->getMessage(),
                'hint' => $problem->getHint(),
                'link' => $problem->getLink(),
            ];
        }

        if (!count($data)) {
            $data = false;
        }

        return $data;
    }
744476
public function getAllNotDeleted(): array
    {
        if (!$this->entityImplements(SoftDeleteInterface::class)) {
            throw new \Exception(sprintf('Entities of class "%s" do not implement interface "%s"', $this->getEntityClassName(), SoftDeleteInterface::class));
        }

        return $this->getEntitiesBy(['deleted' => false]);
    }
921158
public function toArray()
	{
		$list = parent::toArray();

		$list['locale.languageid'] = $this->getLanguageId();
		$list['locale.currencyid'] = $this->getCurrencyId();
		$list['locale.position'] = $this->getPosition();
		$list['locale.status'] = $this->getStatus();

		return $list;
	}
1269889
public function getJsonItemSchemas()
	{
		$list = array();

		foreach( $this->_getControllers() as $name => $controller ) {
			$list[$name] = $controller->getItemSchema();
		}

		if( ( $json = json_encode( $list ) ) === null ) {
			throw new Exception( 'Unable to encode schemas to JSON' );
		}

		return $json;
	}
1369601
public function fetch()
    {
        $adapter = $this->getAdapter();
        if (!$adapter)
            throw new \Exception("Adapter property is not set");

        $adapter->check($this);
        $adapter->filter($this);
        $adapter->sort($this);
        $result = $adapter->paginate($this);

        $filters = $this->getFilters();
        return [
            'sort_column'   => $this->getSortColumn(),
            'sort_dir'      => $this->getSortDir(),
            'page_number'   => $this->getPageNumber(),
            'page_size'     => $this->getPageSize(),
            'total_pages'   => $this->getTotalPages(),
            'filters'       => count($filters) ? $filters : new \StdClass(),
            'rows'          => $result,
        ];
    }
833045
public function getSEPAAccounts()
    {
        $dialog = $this->getDialog();
        $dialog->syncDialog();
        $dialog->initDialog();

        $message = $this->getNewMessage(
            $dialog,
            array(new HKSPA(3)),
            array(AbstractMessage::OPT_PINTAN_MECH => $dialog->getSupportedPinTanMechanisms())
        );

        $result = $dialog->sendMessage($message);
        $dialog->endDialog();
        $sepaAccounts = new  GetSEPAAccounts($result->rawResponse);

        return $sepaAccounts->getSEPAAccountsArray();
    }
731879
public function toArray()
    {
        return array(
            // account
            'accountName' => $this->getAccountName(),
            'uid' => $this->getUid(),
            // contact
            'title' => $this->getTitle(),
            'salutation' => $this->getSalutation(),
            'firstName' => $this->getFirstName(),
            'lastName' => $this->getLastName(),
            'email' => $this->getEmail(),
            'phone' => $this->getPhone(),
            'phoneMobile' => $this->getPhoneMobile(),
            // address
            'street' => $this->getStreet(),
            'number' => $this->getNumber(),
            'addition' => $this->getAddition(),
            'zip' => $this->getZip(),
            'city' => $this->getCity(),
            'state' => $this->getState(),
            'country' => $this->getCountry(),
            'note' => $this->getNote(),
            'contactAddress' => $this->getContactAddress() ? array(
                'id' => $this->getContactAddress()->getId()
            ) : null,
            // postbox
            'postboxCity' => $this->getPostboxCity(),
            'postboxNumber' => $this->getPostboxNumber(),
            'postboxPostcode' => $this->getPostboxPostcode(),
        );
    }
1211167
public function jsonSerialize() : array
    {
        return [
            'id'        => $this->getId(),
            'timestamp' => $this->getTimestamp(),
            'context'   => $this->getContext(),
            'culprit'   => sprintf('%s:%d', $this->throwable->getFile(), $this->throwable->getLine()),
            'exception' => [
                'message'    => $this->throwable->getMessage(),
                'type'       => get_class($this->throwable),
                'code'       => $this->throwable->getCode(),
                'stacktrace' => $this->mapStacktrace(),
            ],
            'processor' => [
                'event' => 'error',
                'name'  => 'error',
            ]
        ];
    }
442232
public function getMessage(): array
    {
        if (!empty($this->message)) {
            return $this->message;
        }

        try {
            $message = XML::parse(strval($this->app['request']->getContent()));
        } catch (\Throwable $e) {
            throw new Exception('Invalid request XML: '.$e->getMessage(), 400);
        }

        if (!is_array($message) || empty($message)) {
            throw new Exception('Invalid request XML.', 400);
        }

        if ($this->check) {
            $this->validate($message);
        }

        return $this->message = $message;
    }
591996
public function collectCommonData()
    {
        /** @var OxpsPaymorrowSettings $oPmSettings */
        $oPmSettings = oxNew( 'OxpsPaymorrowSettings' );

        /** @var oxUser|OxpsPaymorrowOxUser $oUser */
        $oUser = $this->getUser();

        return array(
            'merchantId'           => $oPmSettings->getMerchantId(),
            'mpiSignature'         => $oPmSettings->getMpiSignature(),
            'request_languageCode' => $oUser->getUserPaymorrowRequestLanguage(),
            'request_id'           => $this->getUniqueString(),
        );
    }
1080705
public function validated(): array
    {
        $config = $this->container->make('katsana.manager')->config('webhook');

        $signature = new Signature($config['signature']);
        $header = $this->header('X_SIGNATURE') ?? '';

        if (! $signature->verify($header, $this->getContent(), ($config['threshold'] ?? 3600))) {
            throw new HttpException(419, 'Unable to verify X-Signature.');
        }

        return $this->post();
    }
542136
public function getList()
    {
        $pageType = $this->params('pageType', PageTypes::NORMAL);
        $pageId = $this->params('pageId', null);

        /** @var \Rcm\Validator\Page $validator */
        $validator = clone($this->getServiceLocator()->get(\Rcm\Validator\Page::class));
        $validator->setPageType($pageType);

        $return = [
            'valid' => true
        ];

        if (!$validator->isValid($pageId)) {
            $return['valid'] = false;
            $return['error'] = $validator->getMessages();

            /** @var \Zend\Http\Response $response */
            $response = $this->response;

            $errorCodes = array_keys($return['error']);

            foreach ($errorCodes as &$errorCode) {
                if ($errorCode == $validator::PAGE_EXISTS) {
                    $response->setStatusCode(409);
                    break;
                } elseif ($errorCode == $validator::PAGE_NAME) {
                    $response->setStatusCode(417);
                }
            }
        }

        return new JsonModel($return);
    }
328040
public function materialCount() {
        $args = $this->getCount()->json();
        if (array_key_exists('errcode', $args)) {
            throw new Exception($args['errmsg']);
        }
        return $args;
    }
742998
public function getExecTasks(): array
    {
        $data = [];
        $runTimeTableTasks = $this->getRunTimeTable()->table;
        if (\count($runTimeTableTasks) <= 0) {
            return $data;
        }

        $min = date('YmdHi');

        foreach ($runTimeTableTasks as $key => $value) {
            if ($value['minute'] == $min) {
                if (time() == $value['sec'] && $value['runStatus'] == self::NORMAL) {
                    $data[] = [
                        'key'        => $key,
                        'taskClass'  => $value['taskClass'],
                        'taskMethod' => $value['taskMethod'],
                    ];
                }
            }
        }

        foreach ($data as $item) {
            $this->startTask($item['key']);
        }

        return $data;
    }
55668
public function toArray()
    {
        $result = ['jsonrpc' => '2.0'];
        if ($this->id) {
            $result['id'] = $this->id;
        }
        if ($this->isError) {
            $result['error'] = $this->result;
        } else {
            $result['result'] = $this->result;
        }

        return $result;
    }