+ /**
+ * Gets the campaign ids from the session.
+ *
+ * @return int[]
+ */
+ public function getCampaignIds() {
+ // The unfiltered value from the session cannot be trusted, it needs to be
+ // processed to get a clean array of positive integers.
+ $ids = array();
+ foreach ((array) $this->get('campaign_id') as $id) {
+ if ((string) (int) $id === (string) $id && $id > 0) {
+ $ids[] = $id;
+ }
+ }
+ return $ids;
+ }
+