Re: DB_DataObject and Sequence Table format
| From: | Justin Patrin | Date: | Mon, 15 Nov 2004 19:18:39 +0000 |
| Subject: | Re: DB_DataObject and Sequence Table format | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15535@lists.php.net to get a copy of this message | ||
On Mon, 15 Nov 2004 09:29:11 -0400, Michiel van der Blonk
<michiel@caribmedia.com> wrote:
> Hi all,
>
> I am using DB_DataObject on apache with mysql rather succesfully for a
> while, but I ran into a small problem.
>
> I am using person->insert(). At that point I am faced with the fact that
> the underlying DB class creates a sequence table with a formatting of
> '%s_seq'. I would like to change that format, but I seem to not get it
> done right.
>
> According to the manual it should read something like:
>
> "
> $person = new DataObjects_Person;
> $db= $person->getDatabaseConnection();
This should be:
db =& $person->getDatabaseConnection();
You may also want to use factory() instead of directly instantiating
your dataobjects.
$person = DB_DataObject::factory('person');
> $db->options['seqname_format'] = 'SQ_%s';
> "
>
> When I query the options afterwards, nothing has changed. I am assuming
> I am changing a copy of the DB object here...
>
> I also tried changing the .ini file which DB_DataObject reads, but I
> think it only parses the DB_DataObject part.
>
> "[DB]
> seqname_format = SQ_%s"
>
> How to solve?
>
--
Justin Patrin