PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

hw_api->objectbyanchor> <hw_api_object->value
Last updated: Fri, 22 Aug 2008

view this page in

hw_api->object

(No version information available, might be only in CVS)

hw_api->objectLit les informations d'attribut

Description

hw_api
hw_api_object object ( array $parameter )

Lit les informations d'attribut d'un objet de n'importe quelle version. Elle ne retournera pas le contenu du document.

Liste de paramètres

parameter

Le paramètre parameter est un tableau qui contient l'élément obligatoire "objectIdentifier" et les éléments optionnels "attributeSelector" et "version".

Valeurs de retour

L'objet retourné est une instance de la classe HW_API_Object en cas de succès ou HW_API_Error en cas d'erreur.

Exemples

Cet exemple simple lit un objet et vérifie les erreurs.

Exemple #1 Lit un objet Hyperwave et le vérifie

<?php
function handle_error($error)
{
  
$reason $error->reason(0);
  echo 
"Type: <b>";
  switch (
$reason->type()) {
    case 
0:
      echo 
"Erreur";
      break;
    case 
1:
      echo 
"Alerte";
      break;
    case 
2:
      echo 
"Message";
      break;
  }
  echo 
"</b><br />\n";
  echo 
"Description : " $reason->description("en") . "<br />\n";
}

function 
list_attr($obj)
{
  echo 
"<table>\n";
  
$count $obj->count();
  for (
$i=0$i<$count$i++) {
    
$attr $obj->attribute($i);
    
printf("<tr><td align=\"right\" bgcolor=\"#c0c0c0\"><b>%s</b></td><td bgcolor=\"#F0F0F0\">%s</td></tr>\n",
             
$attr->key(), $attr->value());
  }
  echo 
"</table>\n";
}

$hwapi hwapi_hgcsp($g_config[HOSTNAME]);
$parms = array("objectIdentifier"=>"rootcollection""attributeSelector"=>array("Title""Name""DocumentType"));
$root $hwapi->object($parms);
if (
get_class($root) == "HW_API_Error") {
  
handle_error($root);
  exit;
}
list_attr($root);
?>

Voir aussi



add a note add a note User Contributed Notes
hw_api->object
There are no user contributed notes for this page.

hw_api->objectbyanchor> <hw_api_object->value
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites