phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] null return values in sql_entity


From: Alex Borges
Subject: Re: [Phpgroupware-developers] null return values in sql_entity
Date: Thu, 02 Sep 2004 17:07:54 -0500
User-agent: Mozilla Thunderbird 0.7.3 (X11/20040820)

Dirk Schaller wrote:

The PHPGW_SQL_RUN_SQL case should be something like:
        return $GLOBALS['phpgw']->db->query($sql, __LINE__, __FILE__);

A true or false return values or the number of affected rows is better than >null.
What do you thing about? Could it be realized in a next version?



I think it should. Returning return; is ugly, dull and error prone. I think the rationale was that there is an assertions class that further forward in the system can check for isnull ... so... in any case, there isnt much to change anyhow.

Okay then the contacts backend should use such a class. Outside the
backend I couldt handle any error, because there are many db queries
in some functions and they handle nothing. They get the null from sql
entity and return it. Or sometimes they get it and return anything else.
And for API classes that isnt the finest way.

Agreed. I thought this was how it worked. The assertions class was
made for this. Too bad it wasnt used where it was supposed to be used.
So, we do need to change it at some point to do this. If i remember correctly
the assertions class was php 4.3 dependant (for some reason i cannot
remember) and so it wasnt included in the release.

Anyhow, is there a particular problem youre trying to tacle or is this just
code review?


Dirk


_______________________________________________
Phpgroupware-developers mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/phpgroupware-developers






reply via email to

[Prev in Thread] Current Thread [Next in Thread]