From: Graham B. <gb...@po...> - 2002-06-14 14:26:54
|
On Thu, Jun 13, 2002 at 05:38:52PM +0100, Chris Ridd wrote: > Right, but as Andrew points out that doesn't work. The code: > > $entry->delete('foo', 'bar'); > > fails, despite the documentation ;-) I'm not sure what people really want > to do with this method (as I mentioned I've not really used it before) so > this may really be a documentation bug. How about this instead: > > delete ( ATTR [ => VALUE [, ATTR2 => VALUE2 ... ] ) > > Delete one or more attributes from the entry. Each value must either be a > scalar variable or a reference to an array (an empty array means delete all > the values). As a special case to delete a single attribute completely, > just pass the name of the attribute. The following two examples are > equivalent: > > $entry->delete( 'mail' ); > $entry->delete( 'mail' => [ ] ); The reason the first works is because undef passed as the value is treated the same as [] being passed. Doc patch welcome. Graham. |