Re: ext/overload API
| From: | Andrei Zmievski | Date: | Thu, 14 Nov 2002 13:39:22 +0000 |
| Subject: | Re: ext/overload API | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91032@lists.php.net to get a copy of this message | ||
On Thu, 14 Nov 2002, Timm Friebe wrote:
> Hello,
> Andrei, as I can see, you're the author of ext/overload. As suggested
> earlier, I've added a second parameter to sybase_fetch_object() which
> allows users to pass an object to be filled with the results from the
> fetched row (e.g. $article= sybase_fetch_object($q, new Article()); or
> $article= sybase_fetch_object($q, 'Article')).
>
> Well, if "Article" is an overloaded class, they'd probably expect that
> their __set*-handlers are called when the object's properties are set.
> Of course, object_and_properties_init() does not do this. But indeed,
> it'd be quite nice if they would.
>
> Thus, one would need the C functions call_get_handler and
> call_set_handler to be declared not static but PHPAPI (is this right?)
> and an additional method to test if a zend_class_entry is overloaded.
>
> * http://sitten-polizei.de/php/overload.patch
> would make it work. Maybe macros would be a better way?
>
> * http://sitten-polizei.de/php/sybase_ct.patch
> shows a sample usage (btw, is there any documentation on TSRM?)
> maybe _set_object_prop should be moved to ext/overload as a
> utiltiy function?
>
> I came up with this since I use sybase resultsets within SOAP, clearly
> needing to distinguish strings from datetime types, int, floats and so
> on. My first idea was to introduce a function
> sybase_bind_datatype(SYBASE_DATETIME, 'Date')
> but why not make use of an already existing and powerful extension?
Because this extension is going away in ZE2?
-Andrei http://www.gravitonic.com/
* We reason deeply, when we forcibly feel. *