CVS update: php3/doc/functions
| From: | steinm | Date: | Wed, 02 Jun 1999 10:06:42 +0000 |
| Subject: | CVS update: php3/doc/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6456@lists.php.net to get a copy of this message | ||
Date: Wednesday June 2, 1999 @ 6:06
Author: steinm
Update of /repository/php3/doc/functions
In directory php:/tmp/cvs-serv21084/doc/functions
Modified Files:
hw.sgml
Log Message:
- hw_modifyobject() does proper object locking
Index: php3/doc/functions/hw.sgml
diff -u php3/doc/functions/hw.sgml:1.20 php3/doc/functions/hw.sgml:1.21
--- php3/doc/functions/hw.sgml:1.20 Tue May 11 13:00:50 1999
+++ php3/doc/functions/hw.sgml Wed Jun 2 06:06:40 1999
@@ -338,12 +338,26 @@
The second array <parameter>add</parameter> is a list of attributes
to add. In order to modify an attribute one will have to remove
the old one and add a new one. <function>hw_modifyobject</function>
- will always remove the attributes before it adds attributes.
+ will always remove the attributes before it adds attributes unless
+ the value of the attribute to remove is not a string or array.
+
+ <para>
The keys of both arrays are the attributes name. The value of each
- array element can either be an array of a string. If it is an array
+ array element can either be an array, a string or anything else.
+ If it is an array
each attribute value is constructed by the key of each element plus
- a colon an the value of each element. If it is a string it is taken
- as the attribute value.
+ a colon and the value of each element. If it is a string it is taken
+ as the attribute value. An empty string will result in a complete
+ removal of that attribute. If the value is neither a string nor an
+ array but something else, e.g. an integer, no operation at all will
+ be performed on the attribute. This is neccessary if you want to
+ to add a completely new attribute not just a new value for an existing
+ attribute. If the remove array contained
+ an empty string for that attribute, the attribute would be tried to
+ removed which would fail since it doesn't exist. The following addition of
+ a new value for that attribute would also fail. Setting the value
+ for that attribute to e.g. 0 would not even try to remove it since
+ the addition will work.
<para>
If you would like to change the attribute 'Name' with the current
@@ -361,7 +375,18 @@
</example>
In order to delete/add a name=value pair from/to the object record just
pass the remove/add array and set the last/third parameter to an empty
- array.
+ array. If the attribute is the first one with that name to add, set
+ attribute value in the remove array to an integer.
+ <example>
+ <title>adding a completly new attribute</title>
+ <programlisting role="php">
+ // $connect is an existing connection to the Hyperwave server
+ // $objid is the ID of the object to modify
+ $remarr = array("Name" => 0);
+ $addarr = array("Name" => "articles");
+ $hw_modifyobject($connect, $objid, $remarr, $addarr);
+ </programlisting>
+ </example>
<para>
Note: Multilingual attributes, e.g. 'Title', can be modified in two
ways. Either by providing the attributes value in its native form