<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=DB_DataObject</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/16708" />
      <rdf:li rdf:resource="http://pear.php.net/bug/14794" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13934" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13843" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13798" />
      <rdf:li rdf:resource="http://pear.php.net/bug/13656" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12694" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12550" />
      <rdf:li rdf:resource="http://pear.php.net/bug/11081" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10858" />
      <rdf:li rdf:resource="http://pear.php.net/bug/10326" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9949" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9910" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9793" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9389" />
      <rdf:li rdf:resource="http://pear.php.net/bug/9076" />
      <rdf:li rdf:resource="http://pear.php.net/bug/8092" />
      <rdf:li rdf:resource="http://pear.php.net/bug/7949" />
      <rdf:li rdf:resource="http://pear.php.net/bug/6555" />
      <rdf:li rdf:resource="http://pear.php.net/bug/6202" />
      <rdf:li rdf:resource="http://pear.php.net/bug/5997" />
      <rdf:li rdf:resource="http://pear.php.net/bug/5790" />
      <rdf:li rdf:resource="http://pear.php.net/bug/4713" />
      <rdf:li rdf:resource="http://pear.php.net/bug/4306" />
      <rdf:li rdf:resource="http://pear.php.net/bug/3773" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/16708">
      <title>DB_DataObject: Documentation Problem 16708 [Open] SequenceKey() Required When Not Using INI</title>
      <link>http://pear.php.net/bugs/16708</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Documentation Problem
Reported by mabgfounder
2009-10-17T22:51:31+00:00
PHP: 5.3.0 OS: Windows XP Package Version: 1.8.12

Description:
------------
First off - thanks for maintaining what appears to be a nice db object library. When working from INI files it was easy to get started and worked right out of the box.

However, when I tried to make classes from scratch, using the docs as a guide, I did not realize that sequenceKey() existed nor how critical it was for things to work correctly.

BTW: These are the docs I was using:
http://pear.php.net/manual/en/package.database.db-dataobject.intro-autobuilding.php

I had no reason for the application's account on mysql to be able to create tables (that I knew of) so I did not grant those permissions. Inserts started failing because of an inability to create {tablename}_seq.

I did eventually figure out that a missing sequenceKey() implementation was the problem, and after some experimentation appear to have figured out how to correctly implement it. However, a lot of time would have been saved at it been in the documentation.

Thanks again for all of your time and help. This seems to be a really great library.

Test script:
---------------
You should be able to use the example on the page I listed with a mysql database where the user does not have table create permissions granted.

Expected result:
----------------
Inserts and updates will fail</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Documentation Problem
Reported by mabgfounder
2009-10-17T22:51:31+00:00
PHP: 5.3.0 OS: Windows XP Package Version: 1.8.12

Description:
------------
First off - thanks for maintaining what appears to be a nice db object library. When working from INI files it was easy to get started and worked right out of the box.

However, when I tried to make classes from scratch, using the docs as a guide, I did not realize that sequenceKey() existed nor how critical it was for things to work correctly.

BTW: These are the docs I was using:
http://pear.php.net/manual/en/package.database.db-dataobject.intro-autobuilding.php

I had no reason for the application's account on mysql to be able to create tables (that I knew of) so I did not grant those permissions. Inserts started failing because of an inability to create {tablename}_seq.

I did eventually figure out that a missing sequenceKey() implementation was the problem, and after some experimentation appear to have figured out how to correctly implement it. However, a lot of time would have been saved at it been in the documentation.

Thanks again for all of your time and help. This seems to be a really great library.

Test script:
---------------
You should be able to use the example on the page I listed with a mysql database where the user does not have table create permissions granted.

Expected result:
----------------
Inserts and updates will fail</pre>]]></description>
      <dc:date>2009-10-17T22:51:31+00:00</dc:date>
      <dc:creator>balexander &amp;#x61;&amp;#116; visionpointsystems &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/14794">
      <title>DB_DataObject: Feature/Change Request 14794 [Open] UTF8 Support for MYSQL database</title>
      <link>http://pear.php.net/bugs/14794</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by repher
2008-10-14T09:01:25+00:00
PHP: 5.2.6 OS: irrelevant Package Version: 1.8.8

Description:
------------
Mysql does not use utf8 by default. Since i almost never use anything 
else than utf8, i have to modify the DB_DataObject class everytime to 
execute a 
'set names utf8' query at the end of the _connect function. Maybe we 
should consider implementing a feature to check if there is for 
example a 
'mysql_client_encoding' option in the options.

I have implemented a simple addition to _connect to solve this 
problem:

if (isset($_DB_DATAOBJECT['CONFIG']['mysql_client_encoding'])) {
  if ($_DB_DATAOBJECT['CONNECTIONS'][$this-&gt;_database_dsn_md5]-
&gt;dsn['phptype'] == 'mysqli') {
    $_DB_DATAOBJECT['CONNECTIONS'][$this-&gt;_database_dsn_md5]-
&gt;query(&quot;SET NAMES &quot; . 
$_DB_DATAOBJECT['CONFIG']['mysql_client_encoding'] );
  }
}</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by repher
2008-10-14T09:01:25+00:00
PHP: 5.2.6 OS: irrelevant Package Version: 1.8.8

Description:
------------
Mysql does not use utf8 by default. Since i almost never use anything 
else than utf8, i have to modify the DB_DataObject class everytime to 
execute a 
'set names utf8' query at the end of the _connect function. Maybe we 
should consider implementing a feature to check if there is for 
example a 
'mysql_client_encoding' option in the options.

I have implemented a simple addition to _connect to solve this 
problem:

if (isset($_DB_DATAOBJECT['CONFIG']['mysql_client_encoding'])) {
  if ($_DB_DATAOBJECT['CONNECTIONS'][$this-&gt;_database_dsn_md5]-
&gt;dsn['phptype'] == 'mysqli') {
    $_DB_DATAOBJECT['CONNECTIONS'][$this-&gt;_database_dsn_md5]-
&gt;query(&quot;SET NAMES &quot; . 
$_DB_DATAOBJECT['CONFIG']['mysql_client_encoding'] );
  }
}</pre>]]></description>
      <dc:date>2008-10-14T09:01:25+00:00</dc:date>
      <dc:creator>bernhard &amp;#x64;&amp;#111;&amp;#x74; picher &amp;#x61;&amp;#116; chello &amp;#x64;&amp;#111;&amp;#x74; at</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13934">
      <title>DB_DataObject: Bug 13934 [Open] Problem with MDB2 and getListOf()</title>
      <link>http://pear.php.net/bugs/13934</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Bug
Reported by nahuel
2008-05-18T17:23:32+00:00
PHP: 5.2.0 OS: Linux Package Version: 1.8.8

Description:
------------
I tryied to reload the configuration, with -&gt;databaseStructure()
and an error was expected. I use MDB2.

Test script:
---------------
$db-&gt;databaseStructure(&quot;mysql://user:pass@localhost/database&quot;);

Actual result:
--------------
Fatal error: Call to undefined function: MDB2_Driver_mysql::getListOf(). in /usr/share/php/MDB2.php on line 1936</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Bug
Reported by nahuel
2008-05-18T17:23:32+00:00
PHP: 5.2.0 OS: Linux Package Version: 1.8.8

Description:
------------
I tryied to reload the configuration, with -&gt;databaseStructure()
and an error was expected. I use MDB2.

Test script:
---------------
$db-&gt;databaseStructure(&quot;mysql://user:pass@localhost/database&quot;);

Actual result:
--------------
Fatal error: Call to undefined function: MDB2_Driver_mysql::getListOf(). in /usr/share/php/MDB2.php on line 1936</pre>]]></description>
      <dc:date>2008-09-17T18:47:04+00:00</dc:date>
      <dc:creator>nahuel &amp;#x61;&amp;#116; ahtna &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>DB_DataObject Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13843">
      <title>DB_DataObject: Feature/Change Request 13843 [Open] $_query property not properly restored in fetch()</title>
      <link>http://pear.php.net/bugs/13843</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by markus
2008-05-06T08:39:45+00:00
PHP: 5.2.5 OS: Linux Package Version: 1.8.8

Description:
------------
In fetch(), is there a reason why the $_query property is not restored to its initial value after the last row has been fetched in DB_DataObject::fetch() on line 550?

The property is set to false [line 575] to indicate there is more data to fetch, but after the last row has been fetched there is no reason to keep the DataObject from being reused as far as we can see.

The process of backing up $_query and restoring it is applied successfully in the find() method (see line 410 and 468).</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by markus
2008-05-06T08:39:45+00:00
PHP: 5.2.5 OS: Linux Package Version: 1.8.8

Description:
------------
In fetch(), is there a reason why the $_query property is not restored to its initial value after the last row has been fetched in DB_DataObject::fetch() on line 550?

The property is set to false [line 575] to indicate there is more data to fetch, but after the last row has been fetched there is no reason to keep the DataObject from being reused as far as we can see.

The process of backing up $_query and restoring it is applied successfully in the find() method (see line 410 and 468).</pre>]]></description>
      <dc:date>2008-05-06T09:26:12+00:00</dc:date>
      <dc:creator>markus &amp;#x61;&amp;#116; fischer &amp;#x64;&amp;#111;&amp;#x74; name</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13798">
      <title>DB_DataObject: Feature/Change Request 13798 [Open] Field length validation</title>
      <link>http://pear.php.net/bugs/13798</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by davidsimpson
2008-04-29T04:28:34+00:00
PHP: 5.1.4 OS: Windows/ Linux/ Solaris Package Version: 1.8.8

Description:
------------
Would it be possible to add the field length information (currently shown in the comments added to the DB DataObject class files) to an associative array (fieldname =&gt; length), to allow for some simple data validation?

In particular this would be useful for varchar fields where the DataObject validation could be used prior to attempting to update the database.

I know that Request #6431 was for similar information and has been set to &quot;Wont fix&quot;, but it would be much nicer to be able to hold the field lengths in the data object, as otherwise we either have to query the tableinfo on every update/insert, or catch errors from the database - neither of which seem particularly efficient?

Thanks for all your hard work on DB_DataObject - we have found it to be extremely useful in a number of projects now, using a variety of backend databases (mysql, oracle and postgres).

Test script:
---------------
For example, in the _generateClassTable function 

prior to processing the columns add:

$fieldMaxLen = array();

while processing each column add:

if (isset($t-&gt;len) &amp;&amp; ($t-&gt;type==&quot;VARCHAR&quot;)) {
  $fieldMaxLen[] = &quot;\&quot;{$t-&gt;name}\&quot; =&gt; {$t-&gt;len}&quot;;
}

and following the loop add:

$body .= &quot;    // Array of varchar field max lengths for simple validation\n&quot;;
$body .= &quot;    protected \$varcharsMax = array(&quot;.join($fieldMaxLen, &quot;,\n\t\t\t\t\t\t\t\t\t&quot;).&quot;);&quot;;</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by davidsimpson
2008-04-29T04:28:34+00:00
PHP: 5.1.4 OS: Windows/ Linux/ Solaris Package Version: 1.8.8

Description:
------------
Would it be possible to add the field length information (currently shown in the comments added to the DB DataObject class files) to an associative array (fieldname =&gt; length), to allow for some simple data validation?

In particular this would be useful for varchar fields where the DataObject validation could be used prior to attempting to update the database.

I know that Request #6431 was for similar information and has been set to &quot;Wont fix&quot;, but it would be much nicer to be able to hold the field lengths in the data object, as otherwise we either have to query the tableinfo on every update/insert, or catch errors from the database - neither of which seem particularly efficient?

Thanks for all your hard work on DB_DataObject - we have found it to be extremely useful in a number of projects now, using a variety of backend databases (mysql, oracle and postgres).

Test script:
---------------
For example, in the _generateClassTable function 

prior to processing the columns add:

$fieldMaxLen = array();

while processing each column add:

if (isset($t-&gt;len) &amp;&amp; ($t-&gt;type==&quot;VARCHAR&quot;)) {
  $fieldMaxLen[] = &quot;\&quot;{$t-&gt;name}\&quot; =&gt; {$t-&gt;len}&quot;;
}

and following the loop add:

$body .= &quot;    // Array of varchar field max lengths for simple validation\n&quot;;
$body .= &quot;    protected \$varcharsMax = array(&quot;.join($fieldMaxLen, &quot;,\n\t\t\t\t\t\t\t\t\t&quot;).&quot;);&quot;;</pre>]]></description>
      <dc:date>2008-04-29T04:28:34+00:00</dc:date>
      <dc:creator>david &amp;#x64;&amp;#111;&amp;#x74; simpson &amp;#x61;&amp;#116; tronsystems &amp;#x64;&amp;#111;&amp;#x74; co &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/13656">
      <title>DB_DataObject: Documentation Problem 13656 [Verified] Undocumented CONFIG var quote_identifiers_tableinfo</title>
      <link>http://pear.php.net/bugs/13656</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Documentation Problem
Reported by adamsetzler
2008-04-12T12:14:16+00:00
PHP: 5.2.5 OS:  Package Version: 1.8.8

Description:
------------
Not having &quot;quote_identifiers_tableinfo = 1&quot; causes problems with MDB2 and certain table names.  There is no documentation of this feature outside the code itself.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Documentation Problem
Reported by adamsetzler
2008-04-12T12:14:16+00:00
PHP: 5.2.5 OS:  Package Version: 1.8.8

Description:
------------
Not having &quot;quote_identifiers_tableinfo = 1&quot; causes problems with MDB2 and certain table names.  There is no documentation of this feature outside the code itself.</pre>]]></description>
      <dc:date>2008-09-17T18:46:40+00:00</dc:date>
      <dc:creator>adam &amp;#x64;&amp;#111;&amp;#x74; setzler &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12694">
      <title>DB_DataObject: Documentation Problem 12694 [Verified] $object-&gt;update($original);</title>
      <link>http://pear.php.net/bugs/12694</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Documentation Problem
Reported by banquette
2007-12-14T16:15:37+00:00
PHP: 5.2.5 OS: Windows Package Version: 1.8.7

Description:
------------
As a user said on the &quot;update()&quot; page (http://pear.php.net/manual/en/package.database.db-dataobject.db-dataobject.update.php) :

When called with

$object-&gt;update($original);

this function appears to return true rather than 0 if no rows are affected.

Expected result:
----------------
Should return 0 (as no row affected)

Actual result:
--------------
return true</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Documentation Problem
Reported by banquette
2007-12-14T16:15:37+00:00
PHP: 5.2.5 OS: Windows Package Version: 1.8.7

Description:
------------
As a user said on the &quot;update()&quot; page (http://pear.php.net/manual/en/package.database.db-dataobject.db-dataobject.update.php) :

When called with

$object-&gt;update($original);

this function appears to return true rather than 0 if no rows are affected.

Expected result:
----------------
Should return 0 (as no row affected)

Actual result:
--------------
return true</pre>]]></description>
      <dc:date>2009-10-15T08:17:55+00:00</dc:date>
      <dc:creator>alexor_patator &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; fr</dc:creator>
      <dc:subject>DB_DataObject Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12550">
      <title>DB_DataObject: Bug 12550 [Open] Updating a record to set a field null</title>
      <link>http://pear.php.net/bugs/12550</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Bug
Reported by asnagy
2007-11-29T08:49:09+00:00
PHP: 5.2.2 OS: linux Package Version: 1.8.7

Description:
------------
I am trying to update a record and set a foreign key to &quot;null&quot; however when i call the update method (with debug set on) I see that it tries to set the value to &quot;0&quot; and not &quot;null&quot;

Test script:
---------------
// Unjoin the User from the Tags
$join = new Resource_tags();
$join-&gt;user_id = $this-&gt;id;
$join-&gt;resource_id = $resource-&gt;id;
if ($join-&gt;find(true)) {
    $join-&gt;user_id = 'null';
    $join-&gt;update();
}

Expected result:
----------------
update resource_tags set user_id = null ...

Actual result:
--------------
update resource_tags set user_id = 0 ...</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Bug
Reported by asnagy
2007-11-29T08:49:09+00:00
PHP: 5.2.2 OS: linux Package Version: 1.8.7

Description:
------------
I am trying to update a record and set a foreign key to &quot;null&quot; however when i call the update method (with debug set on) I see that it tries to set the value to &quot;0&quot; and not &quot;null&quot;

Test script:
---------------
// Unjoin the User from the Tags
$join = new Resource_tags();
$join-&gt;user_id = $this-&gt;id;
$join-&gt;resource_id = $resource-&gt;id;
if ($join-&gt;find(true)) {
    $join-&gt;user_id = 'null';
    $join-&gt;update();
}

Expected result:
----------------
update resource_tags set user_id = null ...

Actual result:
--------------
update resource_tags set user_id = 0 ...</pre>]]></description>
      <dc:date>2009-11-03T04:51:05+00:00</dc:date>
      <dc:creator>andrew &amp;#x64;&amp;#111;&amp;#x74; nagy &amp;#x61;&amp;#116; villanova &amp;#x64;&amp;#111;&amp;#x74; edu</dc:creator>
      <dc:subject>DB_DataObject Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/11081">
      <title>DB_DataObject: Feature/Change Request 11081 [Verified] Support for createTables on Postgres with views in schema</title>
      <link>http://pear.php.net/bugs/11081</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by senna
2007-05-19T04:28:44+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
now, you cannot run createTables.php with PostgreSQL when you have defined any views in schema such as 'test_schema.test_view'.

so, I rewrote (Generate.php line220):
                // try getting a list of schema views first. (postgres)
                $views = $__DB-&gt;getListOf('schema.views');
                if (empty($views)|| is_a($views, 'PEAR_Error')) {
                    $views = $__DB-&gt;getListOf('views');
                }

Of cause, this does not work because PEAR_DB don't support 'schema.views'.
Now, I post a request to suport this.(Bug #11080: getListOf('schema.views'))

If my request is accepted in PEAR_DB, please accept this request :-)</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by senna
2007-05-19T04:28:44+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
now, you cannot run createTables.php with PostgreSQL when you have defined any views in schema such as 'test_schema.test_view'.

so, I rewrote (Generate.php line220):
                // try getting a list of schema views first. (postgres)
                $views = $__DB-&gt;getListOf('schema.views');
                if (empty($views)|| is_a($views, 'PEAR_Error')) {
                    $views = $__DB-&gt;getListOf('views');
                }

Of cause, this does not work because PEAR_DB don't support 'schema.views'.
Now, I post a request to suport this.(Bug #11080: getListOf('schema.views'))

If my request is accepted in PEAR_DB, please accept this request :-)</pre>]]></description>
      <dc:date>2008-02-27T01:12:00+00:00</dc:date>
      <dc:creator>senna &amp;#x61;&amp;#116; mugeso &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10858">
      <title>DB_DataObject: Feature/Change Request 10858 [Open] joinAdd function</title>
      <link>http://pear.php.net/bugs/10858</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by banquette
2007-04-27T05:32:46+00:00
PHP: 5.2.1 OS:  Package Version: 

Description:
------------
I d like to use the joinAdd method with a hard coded query like joinAdd(&quot;LEFt JOIN ...&quot;); I did not find a way to pass throught a table ; i mean when a table is not directly &quot;connected&quot; to another.

Test script:
---------------
&lt;-&gt; means a relationship between table (FK/PK)

table0 &lt;-&gt; table1 &lt;-&gt; table2 &lt;-&gt; table3
One can query table1 with a joinAdd on table0 and/or table2 but not with a joinAdd on table3 as there is no direct relationship. To do such a thing query must actually be hard coded... or I did not find the solution ...
That s why I want a &quot;joinAdd(string $join)&quot; : to keep advantage of methods like selectAdd() to avoid a hard coded query.

Thanks.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by banquette
2007-04-27T05:32:46+00:00
PHP: 5.2.1 OS:  Package Version: 

Description:
------------
I d like to use the joinAdd method with a hard coded query like joinAdd(&quot;LEFt JOIN ...&quot;); I did not find a way to pass throught a table ; i mean when a table is not directly &quot;connected&quot; to another.

Test script:
---------------
&lt;-&gt; means a relationship between table (FK/PK)

table0 &lt;-&gt; table1 &lt;-&gt; table2 &lt;-&gt; table3
One can query table1 with a joinAdd on table0 and/or table2 but not with a joinAdd on table3 as there is no direct relationship. To do such a thing query must actually be hard coded... or I did not find the solution ...
That s why I want a &quot;joinAdd(string $join)&quot; : to keep advantage of methods like selectAdd() to avoid a hard coded query.

Thanks.</pre>]]></description>
      <dc:date>2007-04-27T07:13:34+00:00</dc:date>
      <dc:creator>alexor_patator &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; fr</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/10326">
      <title>DB_DataObject: Bug 10326 [Open] Update on record using update($orignal) method with null values inserts 0's</title>
      <link>http://pear.php.net/bugs/10326</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Bug
Reported by spin
2007-03-10T20:25:15+00:00
PHP: 5.2.0 OS: Linux Package Version: 1.8.5

Description:
------------
I've done a get(), the get returns null values for the fields in question. after doing the get, I do not change any values in the form. I submit a form to edit a record in the DB. The database table has several fields that allow NULL values. the update is of the following form.

$object-&gt;update($original)

This bug has been reported before and is still a problem here using mysql.

https://pear.php.net/bugs/bug.php?id=4919&amp;edit=2

Test script:
---------------
I'm sorry but i do not have the skills needed to make a simple test case, I am instead posting debug output from DBDO that shows the state of the original object and the object to be updated and that they are identical with null values in place.
$DO_ORIGINAL===========DO_TblProperties Object
(   [__table] =&gt; tblProperties
    [intPropertyID] =&gt; 3
    [decSqFt] =&gt; 
    [intHalfBaths] =&gt; 
    [intDeposit] =&gt; 
    [intPriceFurnished] =&gt; 
    [intLeaseLength] =&gt; 
$DO_RENTALS===========DO_TblProperties Object
(   [__table] =&gt; tblProperties
    [intPropertyID] =&gt; 3
    [decSqFt] =&gt; 
    [intHalfBaths] =&gt; 
    [intDeposit] =&gt; 
    [intPriceFurnished] =&gt; 
    [intLeaseLength] =&gt; 

Expected result:
----------------
I expect that the DB record would not be updated since the original object and the object to update are identical and have empty values(null) that are allowed to be null in the DB.

Actual result:
--------------
DO_TblProperties   : QUERY       : UPDATE  `tblProperties`  SET `decSqFt` = 0 , `intHalfBaths` = 0 , `intDeposit` = 0 , `intPriceFurnished` = 0 , `intLeaseLength` = 0   WHERE (  `tblProperties`.`intPropertyID` = 3 )</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Bug
Reported by spin
2007-03-10T20:25:15+00:00
PHP: 5.2.0 OS: Linux Package Version: 1.8.5

Description:
------------
I've done a get(), the get returns null values for the fields in question. after doing the get, I do not change any values in the form. I submit a form to edit a record in the DB. The database table has several fields that allow NULL values. the update is of the following form.

$object-&gt;update($original)

This bug has been reported before and is still a problem here using mysql.

https://pear.php.net/bugs/bug.php?id=4919&amp;edit=2

Test script:
---------------
I'm sorry but i do not have the skills needed to make a simple test case, I am instead posting debug output from DBDO that shows the state of the original object and the object to be updated and that they are identical with null values in place.
$DO_ORIGINAL===========DO_TblProperties Object
(   [__table] =&gt; tblProperties
    [intPropertyID] =&gt; 3
    [decSqFt] =&gt; 
    [intHalfBaths] =&gt; 
    [intDeposit] =&gt; 
    [intPriceFurnished] =&gt; 
    [intLeaseLength] =&gt; 
$DO_RENTALS===========DO_TblProperties Object
(   [__table] =&gt; tblProperties
    [intPropertyID] =&gt; 3
    [decSqFt] =&gt; 
    [intHalfBaths] =&gt; 
    [intDeposit] =&gt; 
    [intPriceFurnished] =&gt; 
    [intLeaseLength] =&gt; 

Expected result:
----------------
I expect that the DB record would not be updated since the original object and the object to update are identical and have empty values(null) that are allowed to be null in the DB.

Actual result:
--------------
DO_TblProperties   : QUERY       : UPDATE  `tblProperties`  SET `decSqFt` = 0 , `intHalfBaths` = 0 , `intDeposit` = 0 , `intPriceFurnished` = 0 , `intLeaseLength` = 0   WHERE (  `tblProperties`.`intPropertyID` = 3 )</pre>]]></description>
      <dc:date>2008-03-23T05:33:06+00:00</dc:date>
      <dc:creator>pear &amp;#x61;&amp;#116; spinink &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>DB_DataObject Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9949">
      <title>DB_DataObject: Feature/Change Request 9949 [Verified] Transaction support</title>
      <link>http://pear.php.net/bugs/9949</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by doctor@...
2007-01-25T15:28:44+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.8.5

Description:
------------
Is it possible/reasonable to implement transactions support into DataObject instance ? Maybe something like startTransaction() endTransaction() methods ?</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by doctor@...
2007-01-25T15:28:44+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.8.5

Description:
------------
Is it possible/reasonable to implement transactions support into DataObject instance ? Maybe something like startTransaction() endTransaction() methods ?</pre>]]></description>
      <dc:date>2008-06-29T04:47:40+00:00</dc:date>
      <dc:creator>doctor &amp;#x61;&amp;#116; wil &amp;#x64;&amp;#111;&amp;#x74; linux &amp;#x64;&amp;#111;&amp;#x74; krakow &amp;#x64;&amp;#111;&amp;#x74; pl</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9910">
      <title>DB_DataObject: Feature/Change Request 9910 [Analyzed] Custom connection support</title>
      <link>http://pear.php.net/bugs/9910</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by soso_pub@...
2007-01-22T06:42:59+00:00
PHP: 5.0.0 OS: Any Package Version: 1.8.5

Description:
------------
It would be great that db objects can be set to use a custom db connection. This feature would solve a lot of problems regarding transactions because it adds the possibility to modify multiple db objects inside the same transaction - through the same connection.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by soso_pub@...
2007-01-22T06:42:59+00:00
PHP: 5.0.0 OS: Any Package Version: 1.8.5

Description:
------------
It would be great that db objects can be set to use a custom db connection. This feature would solve a lot of problems regarding transactions because it adds the possibility to modify multiple db objects inside the same transaction - through the same connection.</pre>]]></description>
      <dc:date>2007-03-06T22:34:51+00:00</dc:date>
      <dc:creator>soso_pub &amp;#x61;&amp;#116; yahoo &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9793">
      <title>DB_DataObject: Documentation Problem 9793 [Open] Documentation for Generator missing</title>
      <link>http://pear.php.net/bugs/9793</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Documentation Problem
Reported by powtac@...
2007-01-10T07:41:04+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.8.5

Description:
------------
A documentation for the great feature of the generator is missing.


Somethinge like this:

require_once 'your config file';

require_once 'DB/DataObject.php';
require_once 'DB/DataObject/Generator.php';

DB_DataObject::debugLevel(5);

$generator = new DB_DataObject_Generator;
$generator-&gt;start();</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Documentation Problem
Reported by powtac@...
2007-01-10T07:41:04+00:00
PHP: Irrelevant OS: Irrelevant Package Version: 1.8.5

Description:
------------
A documentation for the great feature of the generator is missing.


Somethinge like this:

require_once 'your config file';

require_once 'DB/DataObject.php';
require_once 'DB/DataObject/Generator.php';

DB_DataObject::debugLevel(5);

$generator = new DB_DataObject_Generator;
$generator-&gt;start();</pre>]]></description>
      <dc:date>2007-01-10T07:41:04+00:00</dc:date>
      <dc:creator>powtac &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>DB_DataObject Documentation Problem</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9389">
      <title>DB_DataObject: Feature/Change Request 9389 [Open] JoinAdd / SelectAs overwriting each other</title>
      <link>http://pear.php.net/bugs/9389</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by Bill@...
2006-11-19T17:36:27+00:00
PHP: 4.3.10 OS: Linux / Windows Package Version: 1.8.4

Description:
------------
When I joinAdd two tables, and use selectAs to keep the fields from one from clashing with the other, they simply overwrite the contents of the first field.

$BUSINESS = DB_DataObject::factory(&quot;Business&quot;);
$BUSINESS-&gt;setId($buid);
$PERSON = DB_DataObject::factory(&quot;Person&quot;);
$BUSINESS-&gt;joinadd($PERSON);
$BUSINESS-&gt;selectAs($PERSON,'person_%s');

With this example, if I have:
BUSINESS.CITY = &quot;BC&quot;
PERSON.CITY = &quot;PC&quot;

I will get results containing:

CITY= &quot;PC&quot;
person_city = &quot;PC&quot;

My Query runs like:
QUERY: SELECT *, `person`.`id` as `person_id` , `person`.`firstname` as `person_firstname` , `person`.`lastname` as `person_lastname` , `person`.`address1` as `person_address1` , `person`.`address2` as `person_address2` , `person`.`city` as `person_city` , `person`.`state` as `person_state` , `person`.`zipcode` as `person_zipcode` , `person`.`latitude` as `person_latitude` , `person`.`longitude` as `person_longitude` , `person`.`gcscore` as `person_gcscore` , `person`.`contactphone` as `person_contactphone` , `person`.`birthdate` as `person_birthdate` , `person`.`role` as `person_role` , `person`.`activeind` as `person_activeind` , `person`.`email` as `person_email` , `person`.`updatedate` as `person_updatedate` , `person`.`accessdate` as `person_accessdate` , `person`.`passwordx` as `person_passwordx` , `person`.`passphrase` as `person_passphrase`
FROM `business`
INNER JOIN `findwellnesspros`.`person` ON `findwellnesspros`.`person`.`id`=`business`.`customerid`
WHERE ( `business`.`id` = 77590 )

Which if I cut it out and run it manually returns the data correctly (appears so).

Anyway, this comes back from debug level 5

dataobjects_business: RESULT: O:9:&quot;db_result&quot;:11:{s:8:&quot;autofree&quot;;b:0;s:3:&quot;dbh&quot;;O:8:&quot;db_mysql&quot;:8:{s:10:&quot;autocommit&quot;;b:1;s:8:&quot;dbsyntax&quot;;s:5:&quot;mysql&quot;;s:3:&quot;dsn&quot;;a:9:{s:7:&quot;phptype&quot;;s:5:&quot;mysql&quot;;s:8:&quot;dbsyntax&quot;;s:5:&quot;mysql&quot;;s:8:&quot;username&quot;;s:8:&quot;fwpuser1&quot;;s:8:&quot;password&quot;;s:13:&quot;working101dog&quot;;s:8:&quot;protocol&quot;;s:3:&quot;tcp&quot;;s:8:&quot;hostspec&quot;;s:9:&quot;localhost&quot;;s:4:&quot;port&quot;;b:0;s:6:&quot;socket&quot;;b:0;s:8:&quot;database&quot;;s:16:&quot;findwellnesspros&quot;;}s:8:&quot;features&quot;;a:7:{s:5:&quot;limit&quot;;s:5:&quot;alter&quot;;s:8:&quot;new_link&quot;;s:5:&quot;4.2.0&quot;;s:7:&quot;numrows&quot;;b:1;s:8:&quot;pconnect&quot;;b:1;s:7:&quot;prepare&quot;;b:0;s:3:&quot;ssl&quot;;b:0;s:12:&quot;transactions&quot;;b:1;}s:9:&quot;fetchmode&quot;;i:1;s:22:&quot;fetchmode_object_class&quot;;s:8:&quot;stdClass&quot;;s:7:&quot;options&quot;;a:8:{s:16:&quot;result_buffering&quot;;i:500;s:10:&quot;persistent&quot;;b:0;s:3:&quot;ssl&quot;;b:0;s:5:&quot;debug&quot;;i:0;s:14:&quot;seqname_format&quot;;s:6:&quot;%s_seq&quot;;s:8:&quot;autofree&quot;;b:0;s:11:&quot;portability&quot;;i:0;s:8:&quot;optimize&quot;;s:11:&quot;performance&quot;;}s:13:&quot;was_connected&quot;;b:1;}s:9:&quot;fetchmode&quot;;i:1;s:22:&quot;fetchmode_object_class&quot;;s:8:&quot;stdClass&quot;;s:11:&quot;limit_count&quot;;N;s:10:&quot;limit_from&quot;;N;s:10:&quot;parameters&quot;;a:0:{}s:5:&quot;query&quot;;s:1045:&quot;SELECT *, `person`.`id` as `person_id` , `person`.`firstname` as `person_firstname` , `person`.`lastname` as `person_lastname` , `person`.`address1` as `person_address1` , `person`.`address2` as `person_address2` , `person`.`city` as `person_city` , `person`.`state` as `person_state` , `person`.`zipcode` as `person_zipcode` , `person`.`latitude` as `person_latitude` , `person`.`longitude` as `person_longitude` , `person`.`gcscore` as `person_gcscore` , `person`.`contactphone` as `person_contactphone` , `person`.`birthdate` as `person_birthdate` , `person`.`role` as `person_role` , `person`.`activeind` as `person_activeind` , `person`.`email` as `person_email` , `person`.`updatedate` as `person_updatedate` , `person`.`accessdate` as `person_accessdate` , `person`.`passwordx` as `person_passwordx` , `person`.`passphrase` as `person_passphrase`
FROM `business` INNER JOIN `findwellnesspros`.`person` ON `findwellnesspros`.`person`.`id`=`business`.`customerid`
WHERE ( `business`.`id` = 77590) &quot;;s:6:&quot;result&quot;;i:0;s:11:&quot;row_counter&quot;;N;s:9:&quot;statement&quot;;N;}


Then when I try to get the data:

dataobjects_business: FETCH: a:63:{s:2:&quot;id&quot;;s:1:&quot;2&quot;;s:10:&quot;customerid&quot;;s:1:&quot;2&quot;;s:4:&quot;name&quot;;s:13:&quot;My Big Muscle&quot;;s:9:&quot;activeind&quot;;s:1:&quot;0&quot;;s:5:&quot;email&quot;;s:18:&quot;bill@explosivo.com&quot;;s:10:&quot;websiteurl&quot;;s:24:&quot;http://www.explosivo.com&quot;;s:8:&quot;address1&quot;;s:8:&quot;74 UpUrs&quot;;s:8:&quot;address2&quot;;s:0:&quot;&quot;;s:4:&quot;city&quot;;s:11:&quot;New Britian&quot;;s:5:&quot;state&quot;;s:2:&quot;CT&quot;;s:7:&quot;zipcode&quot;;s:5:&quot;06489&quot;;s:8:&quot;latitude&quot;;s:8:&quot;0.000000&quot;;s:9:&quot;longitude&quot;;s:8:&quot;0.000000&quot;;s:7:&quot;gcscore&quot;;s:1:&quot;0&quot;;s:12:&quot;contactphone&quot;;s:10:&quot;8606215380&quot;;s:10:&quot;contactfax&quot;;s:0:&quot;&quot;;s:9:&quot;photofile&quot;;s:0:&quot;&quot;;s:10:&quot;updatedate&quot;;N;s:15:&quot;servicelocation&quot;;s:6:&quot;office&quot;;s:10:&quot;traveldist&quot;;s:1:&quot;0&quot;;s:13:&quot;referencesind&quot;;s:1:&quot;0&quot;;s:12:&quot;callbackdays&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursmonbeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursmonend&quot;;s:1:&quot;0&quot;;s:11:&quot;hourstuebeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hourstueend&quot;;s:1:&quot;0&quot;;s:11:&quot;hourswedbeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hourswedend&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursthubeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursthuend&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursfribeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursfriend&quot;;s:1:&quot;0&quot;;s:11:&quot;hourssatbeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hourssatend&quot;;s:1:&quot;0&quot;;s:11:&quot;hourssunbeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hourssunend&quot;;s:1:&quot;0&quot;;s:9:&quot;firstname&quot;;s:4:&quot;Bill&quot;;s:8:&quot;lastname&quot;;s:6:&quot;Chmura&quot;;s:9:&quot;birthdate&quot;;s:10:&quot;1969-08-08&quot;;s:4:&quot;role&quot;;s:13:&quot;administrator&quot;;s:10:&quot;accessdate&quot;;N;s:9:&quot;passwordx&quot;;s:0:&quot;&quot;;s:10:&quot;passphrase&quot;;s:0:&quot;&quot;;s:9:&quot;person_id&quot;;s:1:&quot;2&quot;;s:16:&quot;person_firstname&quot;;s:4:&quot;Bill&quot;;s:15:&quot;person_lastname&quot;;s:6:&quot;Chmura&quot;;s:15:&quot;person_address1&quot;;s:8:&quot;74 UpUrs&quot;;s:15:&quot;person_address2&quot;;s:0:&quot;&quot;;s:11:&quot;person_city&quot;;s:11:&quot;New Britian&quot;;s:12:&quot;person_state&quot;;s:2:&quot;CT&quot;;s:14:&quot;person_zipcode&quot;;s:5:&quot;06489&quot;;s:15:&quot;person_latitude&quot;;s:8:&quot;0.000000&quot;;s:16:&quot;person_longitude&quot;;s:8:&quot;0.000000&quot;;s:14:&quot;person_gcscore&quot;;s:1:&quot;0&quot;;s:19:&quot;person_contactphone&quot;;s:10:&quot;8606215380&quot;;s:16:&quot;person_birthdate&quot;;s:10:&quot;1969-08-08&quot;;s:11:&quot;person_role&quot;;s:13:&quot;administrator&quot;;s:16:&quot;person_activeind&quot;;s:1:&quot;0&quot;;s:12:&quot;person_email&quot;;s:18:&quot;bill@explosivo.com&quot;;s:17:&quot;person_updatedate&quot;;N;s:17:&quot;person_accessdate&quot;;N;s:16:&quot;person_passwordx&quot;;s:0:&quot;&quot;;s:17:&quot;person_passphrase&quot;;s:0:&quot;&quot;;}
dataobjects_business: fetchrow LINE: id = 2
dataobjects_business: fetchrow LINE: customerid = 2
dataobjects_business: fetchrow LINE: name = My Big Muscle
dataobjects_business: fetchrow LINE: activeind = 0
dataobjects_business: fetchrow LINE: email = bill@explosivo.com
dataobjects_business: fetchrow LINE: websiteurl = http://www.explosivo.com
dataobjects_business: fetchrow LINE: address1 = 74 UpUrs
dataobjects_business: fetchrow LINE: address2 =
dataobjects_business: fetchrow LINE: city = New Britian
dataobjects_business: fetchrow LINE: state = CT
dataobjects_business: fetchrow LINE: zipcode = 06489
dataobjects_business: fetchrow LINE: latitude = 0.000000
dataobjects_business: fetchrow LINE: longitude = 0.000000
dataobjects_business: fetchrow LINE: gcscore = 0
dataobjects_business: fetchrow LINE: contactphone = 8606215380
dataobjects_business: fetchrow LINE: contactfax =
dataobjects_business: fetchrow LINE: photofile =
dataobjects_business: fetchrow LINE: updatedate =
dataobjects_business: fetchrow LINE: servicelocation = office
dataobjects_business: fetchrow LINE: traveldist = 0
dataobjects_business: fetchrow LINE: referencesind = 0
dataobjects_business: fetchrow LINE: callbackdays = 0
dataobjects_business: fetchrow LINE: hoursmonbeg = 0
dataobjects_business: fetchrow LINE: hoursmonend = 0
dataobjects_business: fetchrow LINE: hourstuebeg = 0
dataobjects_business: fetchrow LINE: hourstueend = 0
dataobjects_business: fetchrow LINE: hourswedbeg = 0
dataobjects_business: fetchrow LINE: hourswedend = 0
dataobjects_business: fetchrow LINE: hoursthubeg = 0
dataobjects_business: fetchrow LINE: hoursthuend = 0
dataobjects_business: fetchrow LINE: hoursfribeg = 0
dataobjects_business: fetchrow LINE: hoursfriend = 0
dataobjects_business: fetchrow LINE: hourssatbeg = 0
dataobjects_business: fetchrow LINE: hourssatend = 0
dataobjects_business: fetchrow LINE: hourssunbeg = 0
dataobjects_business: fetchrow LINE: hourssunend = 0
dataobjects_business: fetchrow LINE: firstname = Bill
dataobjects_business: fetchrow LINE: lastname = Chmura
dataobjects_business: fetchrow LINE: birthdate = 1969-08-08
dataobjects_business: fetchrow LINE: role = administrator
dataobjects_business: fetchrow LINE: accessdate =
dataobjects_business: fetchrow LINE: passwordx =
dataobjects_business: fetchrow LINE: passphrase =
dataobjects_business: fetchrow LINE: person_id = 2
dataobjects_business: fetchrow LINE: person_firstname = Bill
dataobjects_business: fetchrow LINE: person_lastname = Chmura
dataobjects_business: fetchrow LINE: person_address1 = 74 UpUrs
dataobjects_business: fetchrow LINE: person_address2 =
dataobjects_business: fetchrow LINE: person_city = New Britian
dataobjects_business: fetchrow LINE: person_state = CT
dataobjects_business: fetchrow LINE: person_zipcode = 06489
dataobjects_business: fetchrow LINE: person_latitude = 0.000000
dataobjects_business: fetchrow LINE: person_longitude = 0.000000
dataobjects_business: fetchrow LINE: person_gcscore = 0
dataobjects_business: fetchrow LINE: person_contactphone = 8606215380
dataobjects_business: fetchrow LINE: person_birthdate = 1969-08-08
dataobjects_business: fetchrow LINE: person_role = administrator
dataobjects_business: fetchrow LINE: person_activeind = 0
dataobjects_business: fetchrow LINE: person_email = bill@explosivo.com
dataobjects_business: fetchrow LINE: person_updatedate =
dataobjects_business: fetchrow LINE: person_accessdate =
dataobjects_business: fetchrow LINE: person_passwordx =
dataobjects_business: fetchrow LINE: person_passphrase =
dataobjects_business: fetchrow: business DONE


The business city should be returned as southington.  

$BUSINESS = DB_DataObject::factory(&quot;Business&quot;);
$BUSINESS-&gt;setId($buid);
$PERSON = DB_DataObject::factory(&quot;Person&quot;);
$BUSINESS-&gt;joinadd($PERSON);
$BUSINESS-&gt;selectAs($PERSON,'person_%s');
$BUSINESS-&gt;selectAs($BUSINESS,'business_%s');

Now, if I do this... I get back the original data as shown above, the person table, and the business_ also.  The Person_ and the Business_ both show correct info, but the orignal business data fields are overwritten.

Anything I can do to help, or if you can tell me where to look at the code, or if I am an idiot...

let me know


Expected result:
----------------
SelectAs fields should not overwrite the default fields</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by Bill@...
2006-11-19T17:36:27+00:00
PHP: 4.3.10 OS: Linux / Windows Package Version: 1.8.4

Description:
------------
When I joinAdd two tables, and use selectAs to keep the fields from one from clashing with the other, they simply overwrite the contents of the first field.

$BUSINESS = DB_DataObject::factory(&quot;Business&quot;);
$BUSINESS-&gt;setId($buid);
$PERSON = DB_DataObject::factory(&quot;Person&quot;);
$BUSINESS-&gt;joinadd($PERSON);
$BUSINESS-&gt;selectAs($PERSON,'person_%s');

With this example, if I have:
BUSINESS.CITY = &quot;BC&quot;
PERSON.CITY = &quot;PC&quot;

I will get results containing:

CITY= &quot;PC&quot;
person_city = &quot;PC&quot;

My Query runs like:
QUERY: SELECT *, `person`.`id` as `person_id` , `person`.`firstname` as `person_firstname` , `person`.`lastname` as `person_lastname` , `person`.`address1` as `person_address1` , `person`.`address2` as `person_address2` , `person`.`city` as `person_city` , `person`.`state` as `person_state` , `person`.`zipcode` as `person_zipcode` , `person`.`latitude` as `person_latitude` , `person`.`longitude` as `person_longitude` , `person`.`gcscore` as `person_gcscore` , `person`.`contactphone` as `person_contactphone` , `person`.`birthdate` as `person_birthdate` , `person`.`role` as `person_role` , `person`.`activeind` as `person_activeind` , `person`.`email` as `person_email` , `person`.`updatedate` as `person_updatedate` , `person`.`accessdate` as `person_accessdate` , `person`.`passwordx` as `person_passwordx` , `person`.`passphrase` as `person_passphrase`
FROM `business`
INNER JOIN `findwellnesspros`.`person` ON `findwellnesspros`.`person`.`id`=`business`.`customerid`
WHERE ( `business`.`id` = 77590 )

Which if I cut it out and run it manually returns the data correctly (appears so).

Anyway, this comes back from debug level 5

dataobjects_business: RESULT: O:9:&quot;db_result&quot;:11:{s:8:&quot;autofree&quot;;b:0;s:3:&quot;dbh&quot;;O:8:&quot;db_mysql&quot;:8:{s:10:&quot;autocommit&quot;;b:1;s:8:&quot;dbsyntax&quot;;s:5:&quot;mysql&quot;;s:3:&quot;dsn&quot;;a:9:{s:7:&quot;phptype&quot;;s:5:&quot;mysql&quot;;s:8:&quot;dbsyntax&quot;;s:5:&quot;mysql&quot;;s:8:&quot;username&quot;;s:8:&quot;fwpuser1&quot;;s:8:&quot;password&quot;;s:13:&quot;working101dog&quot;;s:8:&quot;protocol&quot;;s:3:&quot;tcp&quot;;s:8:&quot;hostspec&quot;;s:9:&quot;localhost&quot;;s:4:&quot;port&quot;;b:0;s:6:&quot;socket&quot;;b:0;s:8:&quot;database&quot;;s:16:&quot;findwellnesspros&quot;;}s:8:&quot;features&quot;;a:7:{s:5:&quot;limit&quot;;s:5:&quot;alter&quot;;s:8:&quot;new_link&quot;;s:5:&quot;4.2.0&quot;;s:7:&quot;numrows&quot;;b:1;s:8:&quot;pconnect&quot;;b:1;s:7:&quot;prepare&quot;;b:0;s:3:&quot;ssl&quot;;b:0;s:12:&quot;transactions&quot;;b:1;}s:9:&quot;fetchmode&quot;;i:1;s:22:&quot;fetchmode_object_class&quot;;s:8:&quot;stdClass&quot;;s:7:&quot;options&quot;;a:8:{s:16:&quot;result_buffering&quot;;i:500;s:10:&quot;persistent&quot;;b:0;s:3:&quot;ssl&quot;;b:0;s:5:&quot;debug&quot;;i:0;s:14:&quot;seqname_format&quot;;s:6:&quot;%s_seq&quot;;s:8:&quot;autofree&quot;;b:0;s:11:&quot;portability&quot;;i:0;s:8:&quot;optimize&quot;;s:11:&quot;performance&quot;;}s:13:&quot;was_connected&quot;;b:1;}s:9:&quot;fetchmode&quot;;i:1;s:22:&quot;fetchmode_object_class&quot;;s:8:&quot;stdClass&quot;;s:11:&quot;limit_count&quot;;N;s:10:&quot;limit_from&quot;;N;s:10:&quot;parameters&quot;;a:0:{}s:5:&quot;query&quot;;s:1045:&quot;SELECT *, `person`.`id` as `person_id` , `person`.`firstname` as `person_firstname` , `person`.`lastname` as `person_lastname` , `person`.`address1` as `person_address1` , `person`.`address2` as `person_address2` , `person`.`city` as `person_city` , `person`.`state` as `person_state` , `person`.`zipcode` as `person_zipcode` , `person`.`latitude` as `person_latitude` , `person`.`longitude` as `person_longitude` , `person`.`gcscore` as `person_gcscore` , `person`.`contactphone` as `person_contactphone` , `person`.`birthdate` as `person_birthdate` , `person`.`role` as `person_role` , `person`.`activeind` as `person_activeind` , `person`.`email` as `person_email` , `person`.`updatedate` as `person_updatedate` , `person`.`accessdate` as `person_accessdate` , `person`.`passwordx` as `person_passwordx` , `person`.`passphrase` as `person_passphrase`
FROM `business` INNER JOIN `findwellnesspros`.`person` ON `findwellnesspros`.`person`.`id`=`business`.`customerid`
WHERE ( `business`.`id` = 77590) &quot;;s:6:&quot;result&quot;;i:0;s:11:&quot;row_counter&quot;;N;s:9:&quot;statement&quot;;N;}


Then when I try to get the data:

dataobjects_business: FETCH: a:63:{s:2:&quot;id&quot;;s:1:&quot;2&quot;;s:10:&quot;customerid&quot;;s:1:&quot;2&quot;;s:4:&quot;name&quot;;s:13:&quot;My Big Muscle&quot;;s:9:&quot;activeind&quot;;s:1:&quot;0&quot;;s:5:&quot;email&quot;;s:18:&quot;bill@explosivo.com&quot;;s:10:&quot;websiteurl&quot;;s:24:&quot;http://www.explosivo.com&quot;;s:8:&quot;address1&quot;;s:8:&quot;74 UpUrs&quot;;s:8:&quot;address2&quot;;s:0:&quot;&quot;;s:4:&quot;city&quot;;s:11:&quot;New Britian&quot;;s:5:&quot;state&quot;;s:2:&quot;CT&quot;;s:7:&quot;zipcode&quot;;s:5:&quot;06489&quot;;s:8:&quot;latitude&quot;;s:8:&quot;0.000000&quot;;s:9:&quot;longitude&quot;;s:8:&quot;0.000000&quot;;s:7:&quot;gcscore&quot;;s:1:&quot;0&quot;;s:12:&quot;contactphone&quot;;s:10:&quot;8606215380&quot;;s:10:&quot;contactfax&quot;;s:0:&quot;&quot;;s:9:&quot;photofile&quot;;s:0:&quot;&quot;;s:10:&quot;updatedate&quot;;N;s:15:&quot;servicelocation&quot;;s:6:&quot;office&quot;;s:10:&quot;traveldist&quot;;s:1:&quot;0&quot;;s:13:&quot;referencesind&quot;;s:1:&quot;0&quot;;s:12:&quot;callbackdays&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursmonbeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursmonend&quot;;s:1:&quot;0&quot;;s:11:&quot;hourstuebeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hourstueend&quot;;s:1:&quot;0&quot;;s:11:&quot;hourswedbeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hourswedend&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursthubeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursthuend&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursfribeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hoursfriend&quot;;s:1:&quot;0&quot;;s:11:&quot;hourssatbeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hourssatend&quot;;s:1:&quot;0&quot;;s:11:&quot;hourssunbeg&quot;;s:1:&quot;0&quot;;s:11:&quot;hourssunend&quot;;s:1:&quot;0&quot;;s:9:&quot;firstname&quot;;s:4:&quot;Bill&quot;;s:8:&quot;lastname&quot;;s:6:&quot;Chmura&quot;;s:9:&quot;birthdate&quot;;s:10:&quot;1969-08-08&quot;;s:4:&quot;role&quot;;s:13:&quot;administrator&quot;;s:10:&quot;accessdate&quot;;N;s:9:&quot;passwordx&quot;;s:0:&quot;&quot;;s:10:&quot;passphrase&quot;;s:0:&quot;&quot;;s:9:&quot;person_id&quot;;s:1:&quot;2&quot;;s:16:&quot;person_firstname&quot;;s:4:&quot;Bill&quot;;s:15:&quot;person_lastname&quot;;s:6:&quot;Chmura&quot;;s:15:&quot;person_address1&quot;;s:8:&quot;74 UpUrs&quot;;s:15:&quot;person_address2&quot;;s:0:&quot;&quot;;s:11:&quot;person_city&quot;;s:11:&quot;New Britian&quot;;s:12:&quot;person_state&quot;;s:2:&quot;CT&quot;;s:14:&quot;person_zipcode&quot;;s:5:&quot;06489&quot;;s:15:&quot;person_latitude&quot;;s:8:&quot;0.000000&quot;;s:16:&quot;person_longitude&quot;;s:8:&quot;0.000000&quot;;s:14:&quot;person_gcscore&quot;;s:1:&quot;0&quot;;s:19:&quot;person_contactphone&quot;;s:10:&quot;8606215380&quot;;s:16:&quot;person_birthdate&quot;;s:10:&quot;1969-08-08&quot;;s:11:&quot;person_role&quot;;s:13:&quot;administrator&quot;;s:16:&quot;person_activeind&quot;;s:1:&quot;0&quot;;s:12:&quot;person_email&quot;;s:18:&quot;bill@explosivo.com&quot;;s:17:&quot;person_updatedate&quot;;N;s:17:&quot;person_accessdate&quot;;N;s:16:&quot;person_passwordx&quot;;s:0:&quot;&quot;;s:17:&quot;person_passphrase&quot;;s:0:&quot;&quot;;}
dataobjects_business: fetchrow LINE: id = 2
dataobjects_business: fetchrow LINE: customerid = 2
dataobjects_business: fetchrow LINE: name = My Big Muscle
dataobjects_business: fetchrow LINE: activeind = 0
dataobjects_business: fetchrow LINE: email = bill@explosivo.com
dataobjects_business: fetchrow LINE: websiteurl = http://www.explosivo.com
dataobjects_business: fetchrow LINE: address1 = 74 UpUrs
dataobjects_business: fetchrow LINE: address2 =
dataobjects_business: fetchrow LINE: city = New Britian
dataobjects_business: fetchrow LINE: state = CT
dataobjects_business: fetchrow LINE: zipcode = 06489
dataobjects_business: fetchrow LINE: latitude = 0.000000
dataobjects_business: fetchrow LINE: longitude = 0.000000
dataobjects_business: fetchrow LINE: gcscore = 0
dataobjects_business: fetchrow LINE: contactphone = 8606215380
dataobjects_business: fetchrow LINE: contactfax =
dataobjects_business: fetchrow LINE: photofile =
dataobjects_business: fetchrow LINE: updatedate =
dataobjects_business: fetchrow LINE: servicelocation = office
dataobjects_business: fetchrow LINE: traveldist = 0
dataobjects_business: fetchrow LINE: referencesind = 0
dataobjects_business: fetchrow LINE: callbackdays = 0
dataobjects_business: fetchrow LINE: hoursmonbeg = 0
dataobjects_business: fetchrow LINE: hoursmonend = 0
dataobjects_business: fetchrow LINE: hourstuebeg = 0
dataobjects_business: fetchrow LINE: hourstueend = 0
dataobjects_business: fetchrow LINE: hourswedbeg = 0
dataobjects_business: fetchrow LINE: hourswedend = 0
dataobjects_business: fetchrow LINE: hoursthubeg = 0
dataobjects_business: fetchrow LINE: hoursthuend = 0
dataobjects_business: fetchrow LINE: hoursfribeg = 0
dataobjects_business: fetchrow LINE: hoursfriend = 0
dataobjects_business: fetchrow LINE: hourssatbeg = 0
dataobjects_business: fetchrow LINE: hourssatend = 0
dataobjects_business: fetchrow LINE: hourssunbeg = 0
dataobjects_business: fetchrow LINE: hourssunend = 0
dataobjects_business: fetchrow LINE: firstname = Bill
dataobjects_business: fetchrow LINE: lastname = Chmura
dataobjects_business: fetchrow LINE: birthdate = 1969-08-08
dataobjects_business: fetchrow LINE: role = administrator
dataobjects_business: fetchrow LINE: accessdate =
dataobjects_business: fetchrow LINE: passwordx =
dataobjects_business: fetchrow LINE: passphrase =
dataobjects_business: fetchrow LINE: person_id = 2
dataobjects_business: fetchrow LINE: person_firstname = Bill
dataobjects_business: fetchrow LINE: person_lastname = Chmura
dataobjects_business: fetchrow LINE: person_address1 = 74 UpUrs
dataobjects_business: fetchrow LINE: person_address2 =
dataobjects_business: fetchrow LINE: person_city = New Britian
dataobjects_business: fetchrow LINE: person_state = CT
dataobjects_business: fetchrow LINE: person_zipcode = 06489
dataobjects_business: fetchrow LINE: person_latitude = 0.000000
dataobjects_business: fetchrow LINE: person_longitude = 0.000000
dataobjects_business: fetchrow LINE: person_gcscore = 0
dataobjects_business: fetchrow LINE: person_contactphone = 8606215380
dataobjects_business: fetchrow LINE: person_birthdate = 1969-08-08
dataobjects_business: fetchrow LINE: person_role = administrator
dataobjects_business: fetchrow LINE: person_activeind = 0
dataobjects_business: fetchrow LINE: person_email = bill@explosivo.com
dataobjects_business: fetchrow LINE: person_updatedate =
dataobjects_business: fetchrow LINE: person_accessdate =
dataobjects_business: fetchrow LINE: person_passwordx =
dataobjects_business: fetchrow LINE: person_passphrase =
dataobjects_business: fetchrow: business DONE


The business city should be returned as southington.  

$BUSINESS = DB_DataObject::factory(&quot;Business&quot;);
$BUSINESS-&gt;setId($buid);
$PERSON = DB_DataObject::factory(&quot;Person&quot;);
$BUSINESS-&gt;joinadd($PERSON);
$BUSINESS-&gt;selectAs($PERSON,'person_%s');
$BUSINESS-&gt;selectAs($BUSINESS,'business_%s');

Now, if I do this... I get back the original data as shown above, the person table, and the business_ also.  The Person_ and the Business_ both show correct info, but the orignal business data fields are overwritten.

Anything I can do to help, or if you can tell me where to look at the code, or if I am an idiot...

let me know


Expected result:
----------------
SelectAs fields should not overwrite the default fields</pre>]]></description>
      <dc:date>2006-11-20T21:29:46+00:00</dc:date>
      <dc:creator>Bill &amp;#x61;&amp;#116; Explosivo &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/9076">
      <title>DB_DataObject: Feature/Change Request 9076 [Open] Fetch a specific row</title>
      <link>http://pear.php.net/bugs/9076</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by pas@...
2006-10-17T23:11:19+00:00
PHP: 5.1.6 OS: Debian Package Version: 

Description:
------------
How about changing the following in DataObject.php

function fetch($rownum = NULL)
...
$array = $result-&gt;fetchRow(DB_DATAOBJECT_FETCHMODE_ASSOC, $rownum);

That way you could get any row in the result instead of only the next row. It is already supported by the DB class, so it is a very simple and minor change.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by pas@...
2006-10-17T23:11:19+00:00
PHP: 5.1.6 OS: Debian Package Version: 

Description:
------------
How about changing the following in DataObject.php

function fetch($rownum = NULL)
...
$array = $result-&gt;fetchRow(DB_DATAOBJECT_FETCHMODE_ASSOC, $rownum);

That way you could get any row in the result instead of only the next row. It is already supported by the DB class, so it is a very simple and minor change.</pre>]]></description>
      <dc:date>2006-11-25T12:04:55+00:00</dc:date>
      <dc:creator>pas &amp;#x61;&amp;#116; pas &amp;#x64;&amp;#111;&amp;#x74; net &amp;#x64;&amp;#111;&amp;#x74; au</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/8092">
      <title>DB_DataObject: Feature/Change Request 8092 [Open] The fourth parameter of joinAdd() (DB_DataObject)</title>
      <link>http://pear.php.net/bugs/8092</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by carlosjordao@...
2006-06-30T09:22:11+00:00
PHP: 4.4.2 OS: Linux Package Version: 

Description:
------------
 The joinAdd() fourth parameter is used when we don't have an &lt;database_name&gt;.links.ini, otherwise the DB_DataObject will complain about it.

I propose to change that behavior. This fourth parameter should mean the entire on clause, not only the field used to make the join.

This would be a kind of &quot;force&quot; condition. If you don't have a &lt;database_name&gt;.links.ini, you would use this pamareter anyway, but you can't disable &lt;database_name&gt;.links.ini and use the fourth parameter.

I had experimented this kind of need, once the expression I used in the &quot;on condition&quot; made a different result when it was in the &quot;where&quot; . In this case, I needed a &quot;LEFT&quot; join.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by carlosjordao@...
2006-06-30T09:22:11+00:00
PHP: 4.4.2 OS: Linux Package Version: 

Description:
------------
 The joinAdd() fourth parameter is used when we don't have an &lt;database_name&gt;.links.ini, otherwise the DB_DataObject will complain about it.

I propose to change that behavior. This fourth parameter should mean the entire on clause, not only the field used to make the join.

This would be a kind of &quot;force&quot; condition. If you don't have a &lt;database_name&gt;.links.ini, you would use this pamareter anyway, but you can't disable &lt;database_name&gt;.links.ini and use the fourth parameter.

I had experimented this kind of need, once the expression I used in the &quot;on condition&quot; made a different result when it was in the &quot;where&quot; . In this case, I needed a &quot;LEFT&quot; join.</pre>]]></description>
      <dc:date>2006-09-28T00:18:34+00:00</dc:date>
      <dc:creator>carlosjordao &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/7949">
      <title>DB_DataObject: Feature/Change Request 7949 [Open] ability to select a schema with Generator</title>
      <link>http://pear.php.net/bugs/7949</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by peter.termaten@...
2006-06-20T12:44:04+00:00
PHP: Irrelevant OS: PostgreSQL Package Version: 1.8.4

Description:
------------
Hi,

Using the Generator when building classes from PostgreSQL I figured it would be handy to generate only tables from a particular schema.
This could be achieved in a similar way as selected particular tables, by adding a Configuration option like : 'include_schema_regex'.

'exclude_schema_regex' could add an exclusion of a schema

See code sammple below

Test script:
---------------
Adding the following to Generator.php, method _createTableList
directly after the logic for stripping the schema part from the table name would do the trick:

if (isset($options['include_schema_regex'] ) &amp;&amp;            !preg_match($options['include_schema_regex'],$bits[0])) {
                continue;
            }</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by peter.termaten@...
2006-06-20T12:44:04+00:00
PHP: Irrelevant OS: PostgreSQL Package Version: 1.8.4

Description:
------------
Hi,

Using the Generator when building classes from PostgreSQL I figured it would be handy to generate only tables from a particular schema.
This could be achieved in a similar way as selected particular tables, by adding a Configuration option like : 'include_schema_regex'.

'exclude_schema_regex' could add an exclusion of a schema

See code sammple below

Test script:
---------------
Adding the following to Generator.php, method _createTableList
directly after the logic for stripping the schema part from the table name would do the trick:

if (isset($options['include_schema_regex'] ) &amp;&amp;            !preg_match($options['include_schema_regex'],$bits[0])) {
                continue;
            }</pre>]]></description>
      <dc:date>2006-06-20T12:44:04+00:00</dc:date>
      <dc:creator>peter &amp;#x64;&amp;#111;&amp;#x74; termaten &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/6555">
      <title>DB_DataObject: Feature/Change Request 6555 [Open] Can't update register with id 0</title>
      <link>http://pear.php.net/bugs/6555</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by vtamara@...
2006-01-22T22:51:37+00:00
PHP: Irrelevant OS: Any Package Version: 

Description:
------------
The function update (even in CVS) includes the following piece of code:

if (empty($this-&gt;{$keys[0]}) &amp;&amp; $dataObject !== true) {
    $this-&gt;raiseError(&quot;update: trying to perform an update without 
         the key set, and argument to update is not 
         DB_DATAOBJECT_WHEREADD_ONLY
         &quot;, DB_DATAOBJECT_ERROR_INVALIDARGS);
   return false;  
}

Since the empty function returns true when its argument is
0, the error is produced also when the key of the DataObject
is 0.

In my humble opinion the condition of the if should be:

if ($this-&gt;{$keys[0]}!=0 &amp;&amp;
   empty($this-&gt;{$keys[0]}) &amp;&amp; $dataObject !== true) {

Am I right?

Best regards. Thanks for the good work.  God illuminate us.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by vtamara@...
2006-01-22T22:51:37+00:00
PHP: Irrelevant OS: Any Package Version: 

Description:
------------
The function update (even in CVS) includes the following piece of code:

if (empty($this-&gt;{$keys[0]}) &amp;&amp; $dataObject !== true) {
    $this-&gt;raiseError(&quot;update: trying to perform an update without 
         the key set, and argument to update is not 
         DB_DATAOBJECT_WHEREADD_ONLY
         &quot;, DB_DATAOBJECT_ERROR_INVALIDARGS);
   return false;  
}

Since the empty function returns true when its argument is
0, the error is produced also when the key of the DataObject
is 0.

In my humble opinion the condition of the if should be:

if ($this-&gt;{$keys[0]}!=0 &amp;&amp;
   empty($this-&gt;{$keys[0]}) &amp;&amp; $dataObject !== true) {

Am I right?

Best regards. Thanks for the good work.  God illuminate us.</pre>]]></description>
      <dc:date>2006-01-23T00:10:00+00:00</dc:date>
      <dc:creator>vtamara &amp;#x61;&amp;#116; pasosdejesus &amp;#x64;&amp;#111;&amp;#x74; org</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/6202">
      <title>DB_DataObject: Feature/Change Request 6202 [Open] getLinkArray() missing</title>
      <link>http://pear.php.net/bugs/6202</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by nbraczek@...
2005-12-08T23:25:58+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
The quite usefull method getLinkArray() is not mentioned in the documentation. It is found in DB_DataObject 1.7.15 with a wrong/misleading description.

The doc entry should look like this:

(see 'Test script' field)

regards,
Niels Braczek &lt;nbraczek@bsds.de&gt;

Test script:
---------------
-&gt; getLinkArray()
-&gt; getLinkArray() -- fetch and return a list of related objects

Synopsis
mixed $DB_DataObject-&gt;getLink (string $column [, string $table])

Description
Fetch an array of related objects. This should be used in conjunction with a &lt;dbname&gt;.links.ini file configuration (see the introduction on linking for details on this).
You may also use this with all parameters to specify, the column and related table.

Parameter
* string $column - either column or column.xxxxx
* string $table - name of table to look up value in

Return value
array - array of results (empty array on failure)

Note
This function can not be called statically.

Example
Example xx-1. Getting the related objects

&lt;?php
$person = new DataObjects_Person;
$person-&gt;get(12);
$children = $person-&gt;getLinkArray('children');

echo 'There are ', count($children), ' descendant(s):&lt;br /&gt;';
foreach ($children as $child) {
    echo $child-&gt;name, '&lt;br /&gt;';
}
?&gt;</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by nbraczek@...
2005-12-08T23:25:58+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
The quite usefull method getLinkArray() is not mentioned in the documentation. It is found in DB_DataObject 1.7.15 with a wrong/misleading description.

The doc entry should look like this:

(see 'Test script' field)

regards,
Niels Braczek &lt;nbraczek@bsds.de&gt;

Test script:
---------------
-&gt; getLinkArray()
-&gt; getLinkArray() -- fetch and return a list of related objects

Synopsis
mixed $DB_DataObject-&gt;getLink (string $column [, string $table])

Description
Fetch an array of related objects. This should be used in conjunction with a &lt;dbname&gt;.links.ini file configuration (see the introduction on linking for details on this).
You may also use this with all parameters to specify, the column and related table.

Parameter
* string $column - either column or column.xxxxx
* string $table - name of table to look up value in

Return value
array - array of results (empty array on failure)

Note
This function can not be called statically.

Example
Example xx-1. Getting the related objects

&lt;?php
$person = new DataObjects_Person;
$person-&gt;get(12);
$children = $person-&gt;getLinkArray('children');

echo 'There are ', count($children), ' descendant(s):&lt;br /&gt;';
foreach ($children as $child) {
    echo $child-&gt;name, '&lt;br /&gt;';
}
?&gt;</pre>]]></description>
      <dc:date>2006-05-08T02:35:22+00:00</dc:date>
      <dc:creator>nbraczek &amp;#x61;&amp;#116; bsds &amp;#x64;&amp;#111;&amp;#x74; de</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/5997">
      <title>DB_DataObject: Feature/Change Request 5997 [Open] getlinks on multible column keys</title>
      <link>http://pear.php.net/bugs/5997</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by nikolas.hagelstein@...
2005-11-17T08:14:37+00:00
PHP: Irrelevant OS: Linux 2.4.30 Package Version: 

Description:
------------
AFAIK it,s not possible to use getLinks() in common with multible column links.

e.g.:

3 DB-tables

--------
|person| Primary key on two colums (id and f_id)
--------
|id    |
--------
|f_id  |
--------

------
|firm|
------
|id  |
------

------
|car |  Car belongs to a person which belongs to a firm
------
|p_id|
|----|
|f_id|
------

So getlinks isn't able to fecht a cars corresponding person.</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by nikolas.hagelstein@...
2005-11-17T08:14:37+00:00
PHP: Irrelevant OS: Linux 2.4.30 Package Version: 

Description:
------------
AFAIK it,s not possible to use getLinks() in common with multible column links.

e.g.:

3 DB-tables

--------
|person| Primary key on two colums (id and f_id)
--------
|id    |
--------
|f_id  |
--------

------
|firm|
------
|id  |
------

------
|car |  Car belongs to a person which belongs to a firm
------
|p_id|
|----|
|f_id|
------

So getlinks isn't able to fecht a cars corresponding person.</pre>]]></description>
      <dc:date>2006-03-07T12:13:42+00:00</dc:date>
      <dc:creator>nikolas &amp;#x64;&amp;#111;&amp;#x74; hagelstein &amp;#x61;&amp;#116; googlemail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/5790">
      <title>DB_DataObject: Feature/Change Request 5790 [Open] Automatically determine insert/update for an object</title>
      <link>http://pear.php.net/bugs/5790</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by richtl@...
2005-10-26T11:17:36+00:00
PHP: 5.1.0 OS: Linux Package Version: 

Description:
------------
The MyObjects library has a store() function that automatically determines whether an object should be inserted or updated depending on whether it exists in the database.

I find I'm writing a log of &quot;if this-&gt;find() then update else insert&quot; sorts of structures. It would make sense to move this into the DB_DataObjects code.

What I'm proposing is essentially,

function store() {
  if( object exists in the database ) {
    // update it from object properties
  } else {
    // insert it as a new row
  }
}</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by richtl@...
2005-10-26T11:17:36+00:00
PHP: 5.1.0 OS: Linux Package Version: 

Description:
------------
The MyObjects library has a store() function that automatically determines whether an object should be inserted or updated depending on whether it exists in the database.

I find I'm writing a log of &quot;if this-&gt;find() then update else insert&quot; sorts of structures. It would make sense to move this into the DB_DataObjects code.

What I'm proposing is essentially,

function store() {
  if( object exists in the database ) {
    // update it from object properties
  } else {
    // insert it as a new row
  }
}</pre>]]></description>
      <dc:date>2005-10-27T20:15:38+00:00</dc:date>
      <dc:creator>richtl &amp;#x61;&amp;#116; arscognita &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/4713">
      <title>DB_DataObject: Feature/Change Request 4713 [Verified] builde sql use prepare feature</title>
      <link>http://pear.php.net/bugs/4713</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by kenchou77@...
2005-06-29T21:34:26+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
prepare &amp; execute sql(like PEAR DB Package)

Reproduce code:
---------------
require_once 'DB/DataObject.php';

$config = parse_ini_file('../example.ini',TRUE);
foreach($config as $class=&gt;$values) {
	$options = &amp;PEAR::getStaticProperty($class,'options');
	$options = $values;
}

$sell = DB_DataObject::factory(&quot;SELL_TABLE&quot;);

$sell-&gt;whereAdd('dele = 0');
$sell-&gt;orderBy('ID DESC');
$sell-&gt;limit(0,20);

$count = $sell-&gt;find();


Expected result:
----------------
debug output:
QUERY: SELECT ... FROM (SELECT rownum as linenum, ... FROM (SELECT * FROM SELL_TABLE WHERE dele = 0 ORDER BY ID DESC ) WHERE rownum &lt;= 20) WHERE linenum &gt;= 1

Actual result:
--------------
for Oracle(and other db supported):
QUERY: SELECT ... FROM (SELECT rownum as linenum, ... FROM (SELECT * FROM SELL_TABLE WHERE dele = ? ORDER BY ID DESC ) WHERE rownum &lt;= ?) WHERE linenum &gt;= ?</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by kenchou77@...
2005-06-29T21:34:26+00:00
PHP: Irrelevant OS:  Package Version: 

Description:
------------
prepare &amp; execute sql(like PEAR DB Package)

Reproduce code:
---------------
require_once 'DB/DataObject.php';

$config = parse_ini_file('../example.ini',TRUE);
foreach($config as $class=&gt;$values) {
	$options = &amp;PEAR::getStaticProperty($class,'options');
	$options = $values;
}

$sell = DB_DataObject::factory(&quot;SELL_TABLE&quot;);

$sell-&gt;whereAdd('dele = 0');
$sell-&gt;orderBy('ID DESC');
$sell-&gt;limit(0,20);

$count = $sell-&gt;find();


Expected result:
----------------
debug output:
QUERY: SELECT ... FROM (SELECT rownum as linenum, ... FROM (SELECT * FROM SELL_TABLE WHERE dele = 0 ORDER BY ID DESC ) WHERE rownum &lt;= 20) WHERE linenum &gt;= 1

Actual result:
--------------
for Oracle(and other db supported):
QUERY: SELECT ... FROM (SELECT rownum as linenum, ... FROM (SELECT * FROM SELL_TABLE WHERE dele = ? ORDER BY ID DESC ) WHERE rownum &lt;= ?) WHERE linenum &gt;= ?</pre>]]></description>
      <dc:date>2005-06-30T01:09:44+00:00</dc:date>
      <dc:creator>kenchou77 &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/4306">
      <title>DB_DataObject: Feature/Change Request 4306 [Verified] No way to specify logic condition in nested joinAdd and whereAdd</title>
      <link>http://pear.php.net/bugs/4306</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by ej.grace@...
2005-05-09T10:11:01+00:00
PHP: 4.3.10 OS: Linux Package Version: 

Description:
------------
When combining joinAdd and whereAdd conditions the whereAdd conditions on the seperate objects are combined implicitly with AND in the generated SQL.  

For example 

$country-&gt;whereAdd('name = \'Germany\'');
$person-&gt;joinAdd($country);
$institution-&gt;whereAdd('name = \'test\'');
$person-&gt;joinAdd($institution);
$person-&gt;fetch();

Combines the condition on $country and $institution with 'AND' so that it would fetch people where their names are 'test' AND they are in a country with the name 'Germany'

Reproduce code:
---------------
The following diff adds an optional joinAdd logic parameter which is passed through to the subsequent whereAdd calls.

This allows one to carry out the join add mentioned above returning records with 'Germany' as the name in the country table OR 'test' as the name of the institution.

18c18
&lt;  * @version    CVS: $Id: DataObject.php,v patch 2005/05/09 16:02:00 graceej Exp $
---
&gt;  * @version    CVS: $Id: DataObject.php,v 1.353 2005/04/20 07:50:01 alan_k Exp $
2822,2824d2821
&lt;      * @param    optional $joinLogic string     The whereAdd logic to use when adding whereAdd conditions
&lt;      *                                          to nested joins default is 'OR' (default is 'AND')
&lt;      *
2829c2826
&lt;     function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false, $joinLogic='AND')
---
&gt;     function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false)
2836d2832
&lt;
3016c3012
&lt;                 $this-&gt;whereAdd(&quot;{$joinAs}.{$ofield}={$table}.{$tfield}&quot;,$joinLogic);
---
&gt;                 $this-&gt;whereAdd(&quot;{$joinAs}.{$ofield}={$table}.{$tfield}&quot;);
3055c3051
&lt;                     )),$joinLogic);
---
&gt;                     )));
3059c3055
&lt;                 $this-&gt;whereAdd(&quot;{$joinAs}.{$kSql} = {$obj-&gt;$k}&quot;,$joinLogic);
---
&gt;                 $this-&gt;whereAdd(&quot;{$joinAs}.{$kSql} = {$obj-&gt;$k}&quot;);
3063c3059
&lt;             $this-&gt;whereAdd(&quot;{$joinAs}.{$kSql} = 0&quot;,$joinLogic);
---
&gt;             $this-&gt;whereAdd(&quot;{$joinAs}.{$kSql} = 0&quot;);
3078c3074
&lt;         $this-&gt;whereAdd(&quot;($cond)&quot;,$joinLogic);
---
&gt;         $this-&gt;whereAdd(&quot;($cond)&quot;);</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by ej.grace@...
2005-05-09T10:11:01+00:00
PHP: 4.3.10 OS: Linux Package Version: 

Description:
------------
When combining joinAdd and whereAdd conditions the whereAdd conditions on the seperate objects are combined implicitly with AND in the generated SQL.  

For example 

$country-&gt;whereAdd('name = \'Germany\'');
$person-&gt;joinAdd($country);
$institution-&gt;whereAdd('name = \'test\'');
$person-&gt;joinAdd($institution);
$person-&gt;fetch();

Combines the condition on $country and $institution with 'AND' so that it would fetch people where their names are 'test' AND they are in a country with the name 'Germany'

Reproduce code:
---------------
The following diff adds an optional joinAdd logic parameter which is passed through to the subsequent whereAdd calls.

This allows one to carry out the join add mentioned above returning records with 'Germany' as the name in the country table OR 'test' as the name of the institution.

18c18
&lt;  * @version    CVS: $Id: DataObject.php,v patch 2005/05/09 16:02:00 graceej Exp $
---
&gt;  * @version    CVS: $Id: DataObject.php,v 1.353 2005/04/20 07:50:01 alan_k Exp $
2822,2824d2821
&lt;      * @param    optional $joinLogic string     The whereAdd logic to use when adding whereAdd conditions
&lt;      *                                          to nested joins default is 'OR' (default is 'AND')
&lt;      *
2829c2826
&lt;     function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false, $joinLogic='AND')
---
&gt;     function joinAdd($obj = false, $joinType='INNER', $joinAs=false, $joinCol=false)
2836d2832
&lt;
3016c3012
&lt;                 $this-&gt;whereAdd(&quot;{$joinAs}.{$ofield}={$table}.{$tfield}&quot;,$joinLogic);
---
&gt;                 $this-&gt;whereAdd(&quot;{$joinAs}.{$ofield}={$table}.{$tfield}&quot;);
3055c3051
&lt;                     )),$joinLogic);
---
&gt;                     )));
3059c3055
&lt;                 $this-&gt;whereAdd(&quot;{$joinAs}.{$kSql} = {$obj-&gt;$k}&quot;,$joinLogic);
---
&gt;                 $this-&gt;whereAdd(&quot;{$joinAs}.{$kSql} = {$obj-&gt;$k}&quot;);
3063c3059
&lt;             $this-&gt;whereAdd(&quot;{$joinAs}.{$kSql} = 0&quot;,$joinLogic);
---
&gt;             $this-&gt;whereAdd(&quot;{$joinAs}.{$kSql} = 0&quot;);
3078c3074
&lt;         $this-&gt;whereAdd(&quot;($cond)&quot;,$joinLogic);
---
&gt;         $this-&gt;whereAdd(&quot;($cond)&quot;);</pre>]]></description>
      <dc:date>2005-05-17T18:17:41+00:00</dc:date>
      <dc:creator>ej &amp;#x64;&amp;#111;&amp;#x74; grace &amp;#x61;&amp;#116; imperial &amp;#x64;&amp;#111;&amp;#x74; ac &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/3773">
      <title>DB_DataObject: Feature/Change Request 3773 [Verified] Re: [PEAR-BUG] Bug #3773 [Ctl-&gt;Fbk]: PostgreSQL SERIAL type not supported</title>
      <link>http://pear.php.net/bugs/3773</link>
      <content:encoded><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by ej.grace@...
2005-03-11T08:24:37+00:00
PHP: 4.3.10 OS: Linux Package Version: 

Description:
------------
[PREFIX]
This appears to have been mentioned in bug #57 Auto Sequence problem with PostgreSQL.  This bug report does however contain a workaround which may be useful.


There appears to be a bug in DB::DataObject which causes the autoincrement of primary keys to use a different table to the default table created by PostgreSQL when specifying the SERIAL type.

I suspect that the function -&gt;keys(), -&gt;sequenceKey() et al.  does not return the correct name of the primary key. For this reason the internal bits of DB::DataObject determine the sequence table to be [TABLENAME]_seq rather than the PostgreSQL default [TABLENAME]_[KEYNAME]_seq.

This results in TWO sequence tables, one that is consulted when doing an explicit INSERT query, the other when using the -&gt;insert() member function.

Needless to say these can (and do) clash.

The workaround is as follows:

Instead of using SERIAL, which implies 

colname integer DEFAULT nextval('tablename_colname_seq') NOT NULL

Specify the key as:

id BIGINT DEFAULT nextval('idclash_seq') NOT NULL

This will mean -&gt;insert() and the pgsql INSERT command will use the same sequence key table.

Reproduce code:
---------------
Starting from a blank database:

CREATE TABLE idclash (
  id SERIAL,
  PRIMARY KEY id
);

Then at the psql command line do:

INSERT INTO idclash (id) VALUES (default);
INSERT INTO idclash (id) VALUES (default);

In a script call the insert member function:
-&gt;insert()
-&gt;insert()
-&gt;insert()

Finally at the psql command line do

INSERT INTO idclash (id) VALUES (default);
SELECT id FROM idclash;


Expected result:
----------------
id | 
----|
  1 |
  2 |
  3 |
  4 |
  5 |
  6 |
(6 rows)

Actual result:
--------------
id |
----
 1 |
 2 |
 3 |
(3 rows)</pre>]]></content:encoded>
      <description><![CDATA[<pre>DB_DataObject Feature/Change Request
Reported by ej.grace@...
2005-03-11T08:24:37+00:00
PHP: 4.3.10 OS: Linux Package Version: 

Description:
------------
[PREFIX]
This appears to have been mentioned in bug #57 Auto Sequence problem with PostgreSQL.  This bug report does however contain a workaround which may be useful.


There appears to be a bug in DB::DataObject which causes the autoincrement of primary keys to use a different table to the default table created by PostgreSQL when specifying the SERIAL type.

I suspect that the function -&gt;keys(), -&gt;sequenceKey() et al.  does not return the correct name of the primary key. For this reason the internal bits of DB::DataObject determine the sequence table to be [TABLENAME]_seq rather than the PostgreSQL default [TABLENAME]_[KEYNAME]_seq.

This results in TWO sequence tables, one that is consulted when doing an explicit INSERT query, the other when using the -&gt;insert() member function.

Needless to say these can (and do) clash.

The workaround is as follows:

Instead of using SERIAL, which implies 

colname integer DEFAULT nextval('tablename_colname_seq') NOT NULL

Specify the key as:

id BIGINT DEFAULT nextval('idclash_seq') NOT NULL

This will mean -&gt;insert() and the pgsql INSERT command will use the same sequence key table.

Reproduce code:
---------------
Starting from a blank database:

CREATE TABLE idclash (
  id SERIAL,
  PRIMARY KEY id
);

Then at the psql command line do:

INSERT INTO idclash (id) VALUES (default);
INSERT INTO idclash (id) VALUES (default);

In a script call the insert member function:
-&gt;insert()
-&gt;insert()
-&gt;insert()

Finally at the psql command line do

INSERT INTO idclash (id) VALUES (default);
SELECT id FROM idclash;


Expected result:
----------------
id | 
----|
  1 |
  2 |
  3 |
  4 |
  5 |
  6 |
(6 rows)

Actual result:
--------------
id |
----
 1 |
 2 |
 3 |
(3 rows)</pre>]]></description>
      <dc:date>2006-10-15T21:12:46+00:00</dc:date>
      <dc:creator>ej &amp;#x64;&amp;#111;&amp;#x74; grace &amp;#x61;&amp;#116; imperial &amp;#x64;&amp;#111;&amp;#x74; ac &amp;#x64;&amp;#111;&amp;#x74; uk</dc:creator>
      <dc:subject>DB_DataObject Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
