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