No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

hw_api::object

(PHP 4, PHP 5 < 5.2.0, PECL hwapi SVN)

hw_api::objectRetrieve attribute information

Description

hw_api::object ( array $parameter ) : hw_api_object

This function retrieves the attribute information of an object of any version. It will not return the document content.

PHP: hw_api::object - Manual Home of Manuel PHP  Contents Haut

Parameters

parameter

The parameter array contains the required elements 'objectIdentifier' and the optional elements 'attributeSelector' and 'version'.

PHP: hw_api::object - Manual Home of Manuel PHP  Contents Haut

Return Values

The returned object is an instance of class HW_API_Object on success or HW_API_Error if an error occurred.

PHP: hw_api::object - Manual Home of Manuel PHP  Contents Haut

Examples

This simple example retrieves an object and checks for errors.

Example #1 Retrieve an object

<?php
function handle_error($error)
{
  
$reason $error->reason(0);
  echo 
"Type: <b>";
  switch (
$reason->type()) {
    case 
0:
      echo 
"Error";
      break;
    case 
1:
      echo 
"Warning";
      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);
?>

Find a PHP function

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-hwapi.object.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : http://php.net

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut