[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Phpgroupware-developers] null return values in sql_entity
From: |
Chris Weiss |
Subject: |
Re: [Phpgroupware-developers] null return values in sql_entity |
Date: |
Thu, 2 Sep 2004 08:36:19 -0500 |
well, if it's returning a null value from a database that's different.
"return;" is bad, "return $foo;" where $foo=NULL is not bad.
The null should be handled in the BO or UI layer, depending on its purpose.
On Thu, 2 Sep 2004 09:17:53 +0200 , Dirk Schaller
<address@hidden> 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.
>
>
>
> Dirk
>
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
>
>