[eluser]Unknown[/eluser]
Hi I want to thank you for the library, I just started with codeigniter and keep getting an error in the datamapper.
I get the following error when calling delete of the datamapper.
Code:
Fatal error: Class 'post' not found in C:\Users\Samos\xampp\htdocs\productReview\system\application\libraries\datamapper.php on line 1292
The strange thing is that it deletes the record out of the database, but produces this error.
Code:
function delete($object = '', $related_field = '')
{
if (empty($object) && ! is_array($object))
{
if ( ! empty($this->id))
{
// Begin auto transaction
$this->_auto_trans_begin();
// Delete this object
$this->db->where('id', $this->id);
$this->db->delete($this->table);
// Delete all "has many" and "has one" relations for this object
foreach (array('has_many', 'has_one') as $type) {
foreach ($this->{$type} as $model => $properties)
{
// Prepare model
$class = $properties['class'];
$object = new $class();
$object = new $class(); That is the line where it gives the error.