I am trying to migrate a project into an MVC framework (deciding between CI and Yii).
Now, I have, for the sake of argument, two objects, text and image, which I would like to build based on an object class.
Parent:
class Object() extends Somemodel{
protected $x;
protected $y;
protected $page;
...
methods()...
}
And children:
class Image() extends Object{
protected $width;
protected $height;
...
methods()...
}
class Text() extends Object{
protected $text;
protected $font;
...
methods()...
}
Now as I understand this is a nice approach becasue some common functions like getting x/y coordinates etc. will be placed in the Object while all specific things will be placed in the children classes.
I was hoping to have one table in the database to store the Object.
However frameworks are giving me hard time to try and make it work... which makes me think, that probably I am doing something wrong, because if everyone was doing it like this then, I suppose, frameworks would support that easily.
Any thoughts?