[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: |
Wed, 1 Sep 2004 12:27:30 -0500 |
a plain ol' return; can be usefull, but if any return in a given
function returns a value then thay all need to in that function. This
should also cause php to generate at least a NOTICE error.
On Wed, 01 Sep 2004 11:57:09 -0500, Alex Borges <address@hidden> wrote:
> Dirk Schaller wrote:
>
> >Hi guys,
> >
> >does anyone knows the background why any functions of the sql_entity class
> >return null?
> >A return result of null is not feasible for error handling.
> >
> >See function dekete:
> >
> > switch($action)
> > {
> > case PHPGW_SQL_RETURN_RECORDS:
> > case PHPGW_SQL_RUN_SQL:
> > $GLOBALS['phpgw']->db->query($sql, __LINE__, __FILE__);
> > return;
> > case PHPGW_SQL_RETURN_SQL:
> > return $sql;
> > }
> >
> >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 effected 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.
>
> >greetings
> >Dirk
> >
> >
> >_______________________________________________
> >Phpgroupware-developers mailing list
> >address@hidden
> >http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
> >
> >
> >
>
> _______________________________________________
> Phpgroupware-developers mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
>
>