|
From: | Alex Borges |
Subject: | Re: [Phpgroupware-developers] null return values in sql_entity |
Date: | Wed, 01 Sep 2004 11:57:09 -0500 |
User-agent: | Mozilla Thunderbird 0.7.3 (X11/20040820) |
Dirk Schaller wrote:
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.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?
greetings Dirk _______________________________________________ Phpgroupware-developers mailing list address@hidden http://lists.gnu.org/mailman/listinfo/phpgroupware-developers
[Prev in Thread] | Current Thread | [Next in Thread] |