public static function getCTAOfSite($nb_site, $nb_site_target_cta)
    {
        $retval = null;

        if (is_numeric($nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID)) &&
            is_numeric($nb_site_target_cta_id = nb_getMixedValue($nb_site_target_cta, NABU_SITE_TARGET_CTA_FIELD_ID))
        ) {
            $retval = CNabuSiteTargetCTA::buildObjectFromSQL(
                'select stc.* '
                . 'from nb_site s, nb_site_target st, nb_site_target_cta stc '
               . 'where s.nb_site_id=st.nb_site_id '
                 . 'and st.nb_site_target_id=stc.nb_site_target_id '
                 . 'and s.nb_site_id=%site_id$d '
                 . 'and stc.nb_site_target_cta_id=%cta_id$d',
                array(
                    'site_id' => $nb_site_id,
                    'cta_id' => $nb_site_target_cta_id
                )
            );
        }

        return $retval;
    }
public static function getCTAOfSite($nb_site, $nb_site_target_cta)
    {
        $retval = null;

        if (is_numeric($nb_site_id = nb_getMixedValue($nb_site, NABU_SITE_FIELD_ID)) &&
            is_numeric($nb_site_target_cta_id = nb_getMixedValue($nb_site_target_cta, NABU_SITE_TARGET_CTA_FIELD_ID))
        ) {
            $retval = CNabuSiteTargetCTA::buildObjectFromSQL(
                'select stc.* '
                . 'from nb_site s, nb_site_target st, nb_site_target_cta stc '
               . 'where s.nb_site_id=st.nb_site_id '
                 . 'and st.nb_site_target_id=stc.nb_site_target_id '
                 . 'and s.nb_site_id=%site_id$d '
                 . 'and stc.nb_site_target_cta_id=%cta_id$d',
                array(
                    'site_id' => $nb_site_id,
                    'cta_id' => $nb_site_target_cta_id
                )
            );
        }

        return $retval;
    }
public static function getCTAOfSite ( $ nb_site , $ nb_site_target_cta ) { $ retval = null ; if ( is_numeric ( $ nb_site_id = nb_getMixedValue ( $ nb_site , NABU_SITE_FIELD_ID ) ) && is_numeric ( $ nb_site_target_cta_id = nb_getMixedValue ( $ nb_site_target_cta , NABU_SITE_TARGET_CTA_FIELD_ID ) ) ) { $ retval = CNabuSiteTargetCTA :: buildObjectFromSQL ( 'select stc.* ' . 'from nb_site s, nb_site_target st, nb_site_target_cta stc ' . 'where s.nb_site_id=st.nb_site_id ' . 'and st.nb_site_target_id=stc.nb_site_target_id ' . 'and s.nb_site_id=%site_id$d ' . 'and stc.nb_site_target_cta_id=%cta_id$d' , array ( 'site_id' => $ nb_site_id , 'cta_id' => $ nb_site_target_cta_id ) ) ; } return $ retval ; }
Gets a CTA instance related with a Site.
@param mixed $nb_site A Site instance, or a CNabuDataObject instance containing a field named nb_site_id or an Id.
@param mixed $nb_site_target_cta A Site Target CTA instance, or a CNabuDataObject instance containing a field
named nb_site_target_cta_id or an Id.
@return CNabuSiteTargetCTA | null Returns an instance if found or null if not.
Gets a CTA instance related with a Site .