Welcome Guest, Not a member yet? Register   Sign In
Extending Datamapper
#2

[eluser]WanWizard[/eluser]
Your DataMapperExtra class can't have a constructor. The current Datamapper constructor checks if the class loaded it 'Datamapper' (on which it does some setup) or not, in which case it is assumed to be a model.

To work around it, you can try
Code:
<?php
include "datamapper.php";

class DatamapperExtra extends Datamapper
{
}

and store this in application/libraries/datamapperextra.php.

Additionally, you need to modify datamapper.php:
Code:
//change
        $is_dmz = $this_class == 'datamapper';
// to
        $is_dmz = $this_class == 'datamapperextra';

After this, your models should be able to extend Datamapperextra instead of Datamapper.

Currently I don't see another option.


Messages In This Thread
Extending Datamapper - by El Forum - 08-03-2011, 10:52 AM
Extending Datamapper - by El Forum - 08-03-2011, 11:11 AM
Extending Datamapper - by El Forum - 08-03-2011, 11:26 AM
Extending Datamapper - by El Forum - 08-03-2011, 12:30 PM
Extending Datamapper - by El Forum - 08-03-2011, 10:43 PM
Extending Datamapper - by El Forum - 08-04-2011, 02:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB