Loading modules/activecampaign_dashboard/src/Form/ActiveCampaignCampaigns.php +21 −16 Original line number Diff line number Diff line Loading @@ -13,10 +13,6 @@ class ActiveCampaignCampaigns extends ActiveCampaignDashboard { * {@inheritDoc} */ protected function getTableData(int $page = 0, int $limit = 20): array { $response = $this->api->getCampaigns([], $page, $limit); $data['total'] = $response->total; $data['table_fields'] = [ $this->t('Name'), $this->t('Date send'), Loading @@ -27,6 +23,14 @@ class ActiveCampaignCampaigns extends ActiveCampaignDashboard { $this->t('Unsubscribe rate'), ]; // Check if we have an object containing our data instead of an error // message. $response = $this->api->getCampaigns([], $page, $limit); if (is_string($response)) { $this->messenger()->addError($response); } else { $data['total'] = $response->total; foreach ($response->rows as $key => $campaign) { // Check if the row is actual data or metadata from the api. if (is_numeric($key)) { Loading @@ -42,6 +46,7 @@ class ActiveCampaignCampaigns extends ActiveCampaignDashboard { } } } return $data; } Loading modules/activecampaign_dashboard/src/Form/ActiveCampaignContacts.php +19 −14 Original line number Diff line number Diff line Loading @@ -13,10 +13,6 @@ class ActiveCampaignContacts extends ActiveCampaignDashboard { * {@inheritDoc} */ protected function getTableData(int $page = 0, int $limit = 20): array { $response = $this->api->getContacts([], $page, $limit); $data['total'] = $response->total; $data['table_fields'] = [ $this->t('Email'), $this->t('First Name'), Loading @@ -24,6 +20,14 @@ class ActiveCampaignContacts extends ActiveCampaignDashboard { $this->t('Created'), ]; // Check if we have an object containing our data instead of an error // message. $response = $this->api->getContacts([], $page, $limit); if (is_string($response)) { $this->messenger()->addError($response); } else { $data['total'] = $response->total; foreach ($response->rows as $key => $contact) { // Check if the row is actual data or metadata from the api. if (is_numeric($key)) { Loading @@ -36,6 +40,7 @@ class ActiveCampaignContacts extends ActiveCampaignDashboard { } } } return $data; } Loading modules/activecampaign_dashboard/src/Form/ActiveCampaignLists.php +17 −14 Original line number Diff line number Diff line Loading @@ -14,16 +14,18 @@ class ActiveCampaignLists extends ActiveCampaignDashboard { * {@inheritDoc} */ protected function getTableData(int $page = 0, int $limit = 20): array { $response = $this->api->getLists([], $page, $limit); $data['total'] = $response->total; $data['table_fields'] = [ $this->t('Name'), $this->t('Subscribers'), $this->t('Active Subscribers'), ]; $response = $this->api->getLists([], $page, $limit); if (is_string($response)) { $this->messenger()->addError($response); } else { $data['total'] = $response->total; foreach ($response->rows as $key => $list) { // Check if the row is actual data or metadata from the api. if (is_numeric($key)) { Loading @@ -36,6 +38,7 @@ class ActiveCampaignLists extends ActiveCampaignDashboard { } } } return $data; } Loading Loading
modules/activecampaign_dashboard/src/Form/ActiveCampaignCampaigns.php +21 −16 Original line number Diff line number Diff line Loading @@ -13,10 +13,6 @@ class ActiveCampaignCampaigns extends ActiveCampaignDashboard { * {@inheritDoc} */ protected function getTableData(int $page = 0, int $limit = 20): array { $response = $this->api->getCampaigns([], $page, $limit); $data['total'] = $response->total; $data['table_fields'] = [ $this->t('Name'), $this->t('Date send'), Loading @@ -27,6 +23,14 @@ class ActiveCampaignCampaigns extends ActiveCampaignDashboard { $this->t('Unsubscribe rate'), ]; // Check if we have an object containing our data instead of an error // message. $response = $this->api->getCampaigns([], $page, $limit); if (is_string($response)) { $this->messenger()->addError($response); } else { $data['total'] = $response->total; foreach ($response->rows as $key => $campaign) { // Check if the row is actual data or metadata from the api. if (is_numeric($key)) { Loading @@ -42,6 +46,7 @@ class ActiveCampaignCampaigns extends ActiveCampaignDashboard { } } } return $data; } Loading
modules/activecampaign_dashboard/src/Form/ActiveCampaignContacts.php +19 −14 Original line number Diff line number Diff line Loading @@ -13,10 +13,6 @@ class ActiveCampaignContacts extends ActiveCampaignDashboard { * {@inheritDoc} */ protected function getTableData(int $page = 0, int $limit = 20): array { $response = $this->api->getContacts([], $page, $limit); $data['total'] = $response->total; $data['table_fields'] = [ $this->t('Email'), $this->t('First Name'), Loading @@ -24,6 +20,14 @@ class ActiveCampaignContacts extends ActiveCampaignDashboard { $this->t('Created'), ]; // Check if we have an object containing our data instead of an error // message. $response = $this->api->getContacts([], $page, $limit); if (is_string($response)) { $this->messenger()->addError($response); } else { $data['total'] = $response->total; foreach ($response->rows as $key => $contact) { // Check if the row is actual data or metadata from the api. if (is_numeric($key)) { Loading @@ -36,6 +40,7 @@ class ActiveCampaignContacts extends ActiveCampaignDashboard { } } } return $data; } Loading
modules/activecampaign_dashboard/src/Form/ActiveCampaignLists.php +17 −14 Original line number Diff line number Diff line Loading @@ -14,16 +14,18 @@ class ActiveCampaignLists extends ActiveCampaignDashboard { * {@inheritDoc} */ protected function getTableData(int $page = 0, int $limit = 20): array { $response = $this->api->getLists([], $page, $limit); $data['total'] = $response->total; $data['table_fields'] = [ $this->t('Name'), $this->t('Subscribers'), $this->t('Active Subscribers'), ]; $response = $this->api->getLists([], $page, $limit); if (is_string($response)) { $this->messenger()->addError($response); } else { $data['total'] = $response->total; foreach ($response->rows as $key => $list) { // Check if the row is actual data or metadata from the api. if (is_numeric($key)) { Loading @@ -36,6 +38,7 @@ class ActiveCampaignLists extends ActiveCampaignDashboard { } } } return $data; } Loading