public static function findByKey($nb_site, $key)
    {
        $nb_site_id = nb_getMixedValue($nb_site, 'nb_site_id');
        if (is_numeric($nb_site_id)) {
            $retval = CNabuSiteTarget::buildObjectFromSQL(
                    'select * '
                    . 'from nb_site_target '
                   . 'where nb_site_id=%site_id$d '
                     . "and nb_site_target_key='%key\$s'",
                    array(
                        'site_id' => $nb_site_id,
                        'key' => $key
                    )
            );
        } else {
            $retval = null;
        }
        
        return $retval;
    }
public static function findByKey($nb_site, $key)
    {
        $nb_site_id = nb_getMixedValue($nb_site, 'nb_site_id');
        if (is_numeric($nb_site_id)) {
            $retval = CNabuSiteTarget::buildObjectFromSQL(
                    'select * '
                    . 'from nb_site_target '
                   . 'where nb_site_id=%site_id$d '
                     . "and nb_site_target_key='%key\$s'",
                    array(
                        'site_id' => $nb_site_id,
                        'key' => $key
                    )
            );
        } else {
            $retval = null;
        }
        
        return $retval;
    }
public static function findByKey ( $ nb_site , $ key ) { $ nb_site_id = nb_getMixedValue ( $ nb_site , 'nb_site_id' ) ; if ( is_numeric ( $ nb_site_id ) ) { $ retval = CNabuSiteTarget :: buildObjectFromSQL ( 'select * ' . 'from nb_site_target ' . 'where nb_site_id=%site_id$d ' . "and nb_site_target_key='%key\$s'" , array ( 'site_id' => $ nb_site_id , 'key' => $ key ) ) ; } else { $ retval = null ; } return $ retval ; }
Find an instance identified by nb_site_target_key field.
@param mixed $nb_site Site that owns Site Target
@param string $key Key to search
@return CNabuSiteTarget Returns a valid instance if exists or null if not.
Find an instance identified by nb_site_target_key field .