Re: [Fwd: Issue with DB_DataObject]
| From: | Justin Patrin | Date: | Fri, 07 Jan 2005 06:53:32 +0000 |
| Subject: | Re: [Fwd: Issue with DB_DataObject] | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16769@lists.php.net to get a copy of this message | ||
On Fri, 7 Jan 2005 11:15:47 +1100 (EST), daniel@electroteque.org
<daniel@electroteque.org> wrote:
> -------- Original Message --------
> Subject: Issue with DB_DataObject
> From: <daniel@electroteque.org>
> Date: Fri, January 7, 2005 11:12 am
> To: <pear-general@lists.php.net >
>
> Hi there, having some problems with the generated DbObject classes. I
> made some generatedclasses from the createTable script and the only
> method it made was
>
> function staticGet($k,$v=NULL) { return
> DB_DataObject::staticGet('DataObjects_Users',$k,$v); }
> now when i try to use it like
>
> $person = DB_DataObject::factory('users');
> $person->get(2);
> $person->realname = 'Fred';
> $person->update();
>
> i get this error
>
> Fatal error: Call to undefined method DB_DataObject_Error::get()
>
> Its referencing error for some reason ?
>
However, it extends DB_DataObject, which provides all of the other
methods. The problem is that you're getting a PEAR_Error back because
it can't find the include files.
$person = DB_DataObject::factory('users');
if (PEAR::isError($person)) {
die($person->getMessage().' '.$person->getUserInfo());
}
--
Justin Patrin