public function getCTAs($force = false)
    {
        if ($this->nb_site_target_cta_list->isEmpty() || $force) {
            $this->nb_site_target_cta_list->clear();
            $this->nb_site_target_cta_list->merge(CNabuSiteTargetCTA::getSiteTargetCTAs($this));
            $translations = CNabuSiteTargetCTALanguage::getCTATranslationsForSiteTarget($this);
            if (is_array($translations) && count($translations) > 0) {
                foreach ($translations as $translation) {
                    $nb_site_target_cta = $this->nb_site_target_cta_list->getItem($translation->getSiteTargetCTAId());
                    if ($nb_site_target_cta instanceof CNabuSiteTargetCTA) {
                        $nb_site_target_cta->setTranslation($translation);
                    }
                }
            }
            $roles = CNabuSiteTargetCTARole::getCTARolesForSiteTarget($this);
            if (is_array($roles) && count($roles) > 0) {
                foreach ($roles as $role) {
                    $nb_site_target_cta = $this->nb_site_target_cta_list->getItem($role->getSiteTargetCTAId());
                    if ($nb_site_target_cta instanceof CNabuSiteTargetCTA) {
                        $nb_site_target_cta->addRole($role);
                    }
                }
            }
        }

        return $this->nb_site_target_cta_list;
    }
public function getCTAs($force = false)
    {
        if ($this->nb_site_target_cta_list->isEmpty() || $force) {
            $this->nb_site_target_cta_list->clear();
            $this->nb_site_target_cta_list->merge(CNabuSiteTargetCTA::getSiteTargetCTAs($this));
            $translations = CNabuSiteTargetCTALanguage::getCTATranslationsForSiteTarget($this);
            if (is_array($translations) && count($translations) > 0) {
                foreach ($translations as $translation) {
                    $nb_site_target_cta = $this->nb_site_target_cta_list->getItem($translation->getSiteTargetCTAId());
                    if ($nb_site_target_cta instanceof CNabuSiteTargetCTA) {
                        $nb_site_target_cta->setTranslation($translation);
                    }
                }
            }
            $roles = CNabuSiteTargetCTARole::getCTARolesForSiteTarget($this);
            if (is_array($roles) && count($roles) > 0) {
                foreach ($roles as $role) {
                    $nb_site_target_cta = $this->nb_site_target_cta_list->getItem($role->getSiteTargetCTAId());
                    if ($nb_site_target_cta instanceof CNabuSiteTargetCTA) {
                        $nb_site_target_cta->addRole($role);
                    }
                }
            }
        }

        return $this->nb_site_target_cta_list;
    }
public function getCTAs ( $ force = false ) { if ( $ this -> nb_site_target_cta_list -> isEmpty ( ) || $ force ) { $ this -> nb_site_target_cta_list -> clear ( ) ; $ this -> nb_site_target_cta_list -> merge ( CNabuSiteTargetCTA :: getSiteTargetCTAs ( $ this ) ) ; $ translations = CNabuSiteTargetCTALanguage :: getCTATranslationsForSiteTarget ( $ this ) ; if ( is_array ( $ translations ) && count ( $ translations ) > 0 ) { foreach ( $ translations as $ translation ) { $ nb_site_target_cta = $ this -> nb_site_target_cta_list -> getItem ( $ translation -> getSiteTargetCTAId ( ) ) ; if ( $ nb_site_target_cta instanceof CNabuSiteTargetCTA ) { $ nb_site_target_cta -> setTranslation ( $ translation ) ; } } } $ roles = CNabuSiteTargetCTARole :: getCTARolesForSiteTarget ( $ this ) ; if ( is_array ( $ roles ) && count ( $ roles ) > 0 ) { foreach ( $ roles as $ role ) { $ nb_site_target_cta = $ this -> nb_site_target_cta_list -> getItem ( $ role -> getSiteTargetCTAId ( ) ) ; if ( $ nb_site_target_cta instanceof CNabuSiteTargetCTA ) { $ nb_site_target_cta -> addRole ( $ role ) ; } } } } return $ this -> nb_site_target_cta_list ; }
Get CTAs assigned to this Site Target instance.
@param bool $force If true, the CTA list is refreshed from the database.
@return CNabuSiteTargetCTAList Returns the list of CTAs. If none CTA exists, the list is empty.
Get CTAs assigned to this Site Target instance .