/** * */ public function testgetAllAdSetsReturnsAtLeastOneAdset() { $accountManager = new FacebookAccountManager(); $accounts = $accountManager->getAllAccounts(); $accountIndex = 1; $subject = new FacebookAdsManager($accounts[$accountIndex]['access_token'], $accounts[$accountIndex]['app_id'], $accounts[$accountIndex]['app_secret'], $accounts[$accountIndex]['account_id']); $data = $subject->getAllAdSets(); print_r($data); }
/** * @Route("/ad-accounts", name="ad_accounts") * @return \Symfony\Component\HttpFoundation\Response */ public function adAccountsAction() { $facebookAccountManager = new \FacebookAccountManager(); $fbAccounts = $facebookAccountManager->getAllAccounts(); $adAccounts = []; foreach ($fbAccounts as $fbAccount) { $tmpAccount["title"] = $fbAccount['name']; $tmpAccount["id"] = $fbAccount['id']; $tmpAccount["type"] = "facebook"; $tmpAccount["typeImage"] = "http://findicons.com/files/icons/1785/social_and_web_icons_v2/46/facebook.png"; $adAccounts[] = $tmpAccount; } return $this->render('default/ad_accounts.html.twig', ['adAccounts' => $adAccounts]); }