getAppsFromFacebookAccount

@return Array
421527
public function getAppsFromFacebookAccount(array $fb_config_data)
    {
        $registeredFbApps = array();
        $returnedFbApps = array();

        // Get all Facebook apps already persisted into Playground

        $pgApps = $this->getAppMapper()->findAll();
        foreach ($pgApps as $app) {
            $registeredFbApps[$app->getAppId()] = true;
        }

        // Retrieve user Facebook identifier, if user is connected to Facebook

        $user = null;

        $facebookPtf = new \Facebook(array(
            'appId' => $fb_config_data['fb_appid'],
            'secret' => $fb_config_data['fb_secret'],
            'cookie' => false
        ));

        $user = $facebookPtf->getUser();

        // Try to retrieve apps from Facebook, if user is connected to Facebook

        if ($user) {
            try {
                // Retrieve apps administred by the user, if the Facebook account is a developer account

                $userFbApps = $facebookPtf->api('/me/applications/developer', 'GET');

                if (isset($userFbApps['data']) && is_array($userFbApps['data'])) {
                    foreach ($userFbApps['data'] as $userFbApp) {
                        if (! array_key_exists($userFbApp['id'], $registeredFbApps)) { // ignore App ID already registered in Playground
                            $returnedFbApps['apps_from_developer'][] = $userFbApp;
                        } else {
                            $registeredFbApps[$userFbApp['id']] = true; // mark App ID as seen, in order to show it only one time
                        }
                    }
                }

                // Retrieve apps from pages administred by the user (apps that are into page tabs)

                $userFbPages = $facebookPtf->api('/me/accounts', 'GET');

                if (isset($userFbPages['data']) && is_array($userFbPages['data'])) {
                    foreach ($userFbPages['data'] as $userFbPage) {
                        if (array_key_exists('id', $userFbPage)) {
                            $userFbPageId = $userFbPage['id'];
                            $userFbPageName = $userFbPage['name'];
                            $userFbTabs = $facebookPtf->api('/' . $userFbPageId . '/tabs', 'GET');

                            if (isset($userFbTabs['data']) && is_array($userFbTabs['data'])) {
                                foreach ($userFbTabs['data'] as $userFbTab) {
                                    if (array_key_exists('application', $userFbTab)) {
                                        $userFbApp = $userFbTab['application'];
                                        if (! array_key_exists($userFbApp['id'], $registeredFbApps)) { // ignore App ID already registered in Playground
                                            $userFbApp['page_id'] = $userFbPageId;
                                            $userFbApp['page_name'] = $userFbPageName;
                                            $returnedFbApps['apps_from_pages'][] = $userFbApp;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            } catch (\FacebookApiException $e) {
            }
        }

        return $returnedFbApps;
    }
1366372
public function getAccessoires()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        // Performance
        if (!$myConfig->getConfigParam('bl_perfLoadAccessoires')) {
            return;
        }

        $oAcclist = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
        $oAcclist->setSqlLimit(0, $myConfig->getConfigParam('iNrofCrossellArticles'));
        $oAcclist->loadArticleAccessoires($this->oxarticles__oxid->value);

        if ($oAcclist->count()) {
            return $oAcclist;
        }
    }
1257786
public function getAccounts()
    {
        $accounts = $this->serviceHelper->getService()->management_accounts->listManagementAccounts()->getItems();
        $data = array();

        foreach ($accounts as $account) {
            $data[$account->getName()] = array(
                    'accountId' => $account->getId(),
                    'accountName' => $account->getName(),
                );
        }
        ksort($data);

        return $data;
    }
554340
public function getAppNames()
    {
        $apps = [];
        if ($projectRoot = $this->getWelcomeCommand()->getProjectRoot()) {
            foreach (LocalApplication::getApplications($projectRoot) as $app) {
                $name = $app->getName();
                if ($name !== null) {
                    $apps[] = $name;
                }
            }
        } elseif ($project = $this->getProject()) {
            if ($environment = $this->api->getEnvironment('master', $project, false)) {
                $apps = array_keys($environment->getSshUrls());
            }
        }

        return $apps;
    }
1310934
public function getAccountEntries()
    {
        $entries = [];
        foreach ($this->extensions as $name => $extension) {
            if (null !== $e = $extension->getAccountMenuEntries()) {
                $entries = array_merge($entries, $e);
            }
        }
        return $entries;
    }
253875
public function getFacebookHelper()
        {
            $redirectHelper = new FacebookRedirectLoginHelper(
                $this->getRedirectUrl(),
                $this->appId,
                $this->appSecret
            );

            $redirectHelper->disableSessionStatusCheck();

            return $redirectHelper;
        }
131304
public function getAllBookmarks()
    {

        $iTotalBookmarks = $this->GetBookmarksCount();
        $listBookmarks = array();
        for ($index = 1; $index <= $iTotalBookmarks; $index++) {
            array_push($listBookmarks, $this->GetBookmark($index));
        }
        return $listBookmarks;
    }
298988
protected function obtainAppSystemList(): array
    {
        $appSystemList = parent::obtainAppSystemList();
        
        //Remove not used systems
        unset(
            $appSystemList['request'],
            $appSystemList['session'],
            $appSystemList['errors'],
            $appSystemList['ctrlRouterLink']
        );
        
        $appSystemNS = '\BFW\Install\Core\AppSystems\\';
        
        //Change ModuleList class
        $appSystemList['moduleList'] = $appSystemNS.'ModuleList';
        
        //Add new system : module installation system
        $appSystemList['moduleInstall'] = $appSystemNS.'ModuleInstall';
        
        return $appSystemList;
    }
179783
protected function obtainAppSystemList(): array
    {
        $appSystemNS = '\BFW\Core\AppSystems\\';
        
        return [
            'options'        => $appSystemNS.'Options',
            'constants'      => $appSystemNS.'Constants',
            'composerLoader' => $appSystemNS.'ComposerLoader',
            'subjectList'    => $appSystemNS.'SubjectList',
            'config'         => $appSystemNS.'Config',
            'monolog'        => $appSystemNS.'Monolog',
            'request'        => $appSystemNS.'Request',
            'session'        => $appSystemNS.'Session',
            'errors'         => $appSystemNS.'Errors',
            'memcached'      => $appSystemNS.'Memcached',
            'moduleList'     => $appSystemNS.'ModuleList',
            'ctrlRouterLink' => $appSystemNS.'CtrlRouterLink'
        ];
    }
451215
public function getOffsetAccount()
    {
        foreach ($this->getJournal()->getPostings() as $posting)
        {
            if ($posting->getAccount()->getId() != $this->getAccount()->getId())
            {
                return $posting->getAccount();
            }
        }
    }
865113
public function getBookmarks()
    {
        //build URI
        $strURI = Product::$baseProductUri . '/words/' . $this->getFileName() . '/bookmarks';

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);        
        
        if ($json->Code == 200) {
            return $json->Bookmarks->BookmarkList;
        }
        
        AsposeApp::getLogger()->warning('Error occured, http 200 code was not found.', array(
            'json-code' => $json->Code,
        ));
        return false;
    }
130988
public function getAccountList()
    {
        $result = $this->wechat->httpGet(self::WECHAT_ACCOUNT_LIST_GET_PREFIX, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['kf_list']) ? $result['kf_list'] : false;
    }
280981
public function getAccountInfo()
    {
        $response     = $this->makeRequest(Client::HEAD);
        $nbContainers = 0;
        $totalSize    = 0;
        $metadata     = array();

        foreach ($response['headers'] as $name => $value) {
            $name = strtolower($name);

            if (0 === strcmp($name, 'x-account-container-count')) {
                $nbContainers = intval($value);
            } elseif (0 === strcmp($name, 'x-account-bytes-used')) {
                $totalSize = intval($value);
            } elseif (0 === strpos($name, 'x-account-meta-')) {
                $metadata[substr($name, 15)] = $value;
            }
        }

        return array(
            $nbContainers,
            $totalSize,
            $metadata
        );
    }
361066
public function getAuthors()
    {
        $result = false;
        if($this->__manifest !== false)
        {
            $authors = $this->__manifest->get('authors', array());
            $result = ObjectConfig::unbox($authors);
        }

        return $result;
    }
1033784
public function getAccountList()
    {
        $url = "https://api.weixin.qq.com/cgi-bin/customservice/getkflist?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpGetForJson($url);
    }
96334
protected function getAppParameters()
    {
        return array_merge(
            array(
                'app.root_dir' => $this->rootDir,
                'app.environment' => $this->environment,
                'app.debug' => $this->debug,
                'app.name' => $this->name,
                'app.cache_dir' => $this->getCacheDir(),
                'app.logs_dir' => $this->getLogDir(),
                'app.charset' => $this->getCharset(),
            ),
            $this->getEnvParameters()
        );
    }
141244
final protected function showAppsRegister()
    {
        $file = json_decode(file_get_contents(FEnvFcm::get("framework.config.core.apps.file")));
        $i = 1;
        if (count($file) == 0) {
            Output::outputAsError("Ops! You have no app registered. Please create an app with app");
        }
        $str = "";
        foreach ($file as $val) {
            $str .= $i.") ".$val->name.(($val->enabled == "yes")? " : Enabled" : "Disabled")."\n";
            array_push($this->params['applist'], $val->name);
            $i++;
        }

        Output::outputAsNormal("Your apps \n------------\n".$str, "none");
        return (false);
    }