Ive some clases that share some attributes, and i would like to do something like: $dog = (Dog) $cat;
is it posible or is there any generic work around?
Its not a superclass, or a interface or related in any way. They are just 2 different clases i would like php map the attributes from a cat class to a dog and give me the new object. –
i guess ihave to specify a little bit more cause seem like a senseless thing to do.
ive clases that inherits from diferents parent clases cause ive made an inheritance tree based on the saving method, maybe my bad from the begining, but the problem is that i have a lot of clases that are practically equal but interacts one with mysql and the otherone with xml files. so i have: class MySql_SomeEntity extends SomeMysqlInteract{} and Xml_SomeEntity extends SomeXmlInteract{} its a little bit deeper tree but the problem its that. i cant make them inherits from the same class cause multimple inheritance is not alowed, and i cant separate current interaction with superclases cause would be a big throuble.
Basically the atributes in each one are practical the same.
since i have a lot of this maching clases i would like to do some generic casting or something like it that can converts (pass the values to each atribute) and but im trying to search the simplest way to everyone of this clases.