Welcome Guest, Not a member yet? Register   Sign In
question about CI abilities
#7

[eluser]WanWizard[/eluser]
You can do that in CI, you only have to make sure your abstract model is loaded before you load one of the derived models.

But you can't do in PHP what you want to. PHP is weak typed, and therefore will never support polymorphism like implemented in languages like C++ or Java.

To access a method() in Derived_model_1, you have to use $this->Derived_model_1->method().

You can work around that by using $this->abstract_class->my_method( $this->derived_model_2 ) which then calls $this->derived_model_2->my_method(), but it's a clumsy workaround.


Messages In This Thread
question about CI abilities - by El Forum - 07-15-2010, 08:31 PM
question about CI abilities - by El Forum - 07-16-2010, 02:11 AM
question about CI abilities - by El Forum - 07-16-2010, 02:15 AM
question about CI abilities - by El Forum - 07-16-2010, 02:37 AM
question about CI abilities - by El Forum - 07-16-2010, 02:55 AM
question about CI abilities - by El Forum - 07-16-2010, 03:04 AM
question about CI abilities - by El Forum - 07-16-2010, 03:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB