Hi,
I'm pretty new to Object Oriented design in PHP (although I'm using PHP
since a long time, and I also code with Java, so this is not a problem
for me) and I need some help with PEAR::DataObjec t
(http://pear.php.net/package/DB_DataObject).
I tried several times to get it to run but there seem to be some
concepts that I can't get...
I can't even use the Factory to build an object since I get the
following error:
-----ERROR-----
DB_DataObject Error: factory could not find class from Project
----/ERROR-----
Project is a class I wrote (or to be more precise DataObjects_Pro ject).
Ok so here comes my config:
///////////////////////////////////////////////////////////////////////////////
// Setup of DataObject stuff.
$options = &PEAR::getStati cProperty('DB_D ataObject','opt ions');
$options = array(
'database' => $dsn,
'schema_locatio n' => dirname(__FILE_ _).'/DataObjects',
'class_location ' => dirname(__FILE_ _).'/DataObjects',
'require_prefix ' => 'DataObjects/',
'class_prefix' => 'DataObjects_',
);
//
///////////////////////////////////////////////////////////////////////////////
(copied right from the user manual...)
And I have a class DataObjects_Pro ject in
../DataObjects/DataObjects_Pro ject.php:
///////////////////////////////////////////////////////////////////////////////
class DataObjects_Pro ject extends DB_DataObject {
var $project_id;
var $project_descri ption;
var $project_date;
}
///////////////////////////////////////////////////////////////////////////////
As you can see nothing fancy here, but I want to be able to load the
data from the database before expanding the classes...
Can someone help me???
I'm pretty new to Object Oriented design in PHP (although I'm using PHP
since a long time, and I also code with Java, so this is not a problem
for me) and I need some help with PEAR::DataObjec t
(http://pear.php.net/package/DB_DataObject).
I tried several times to get it to run but there seem to be some
concepts that I can't get...
I can't even use the Factory to build an object since I get the
following error:
-----ERROR-----
DB_DataObject Error: factory could not find class from Project
----/ERROR-----
Project is a class I wrote (or to be more precise DataObjects_Pro ject).
Ok so here comes my config:
///////////////////////////////////////////////////////////////////////////////
// Setup of DataObject stuff.
$options = &PEAR::getStati cProperty('DB_D ataObject','opt ions');
$options = array(
'database' => $dsn,
'schema_locatio n' => dirname(__FILE_ _).'/DataObjects',
'class_location ' => dirname(__FILE_ _).'/DataObjects',
'require_prefix ' => 'DataObjects/',
'class_prefix' => 'DataObjects_',
);
//
///////////////////////////////////////////////////////////////////////////////
(copied right from the user manual...)
And I have a class DataObjects_Pro ject in
../DataObjects/DataObjects_Pro ject.php:
///////////////////////////////////////////////////////////////////////////////
class DataObjects_Pro ject extends DB_DataObject {
var $project_id;
var $project_descri ption;
var $project_date;
}
///////////////////////////////////////////////////////////////////////////////
As you can see nothing fancy here, but I want to be able to load the
data from the database before expanding the classes...
Can someone help me???