I have such hierarchy of classes
class Question extends yii\db\ActiveRecord {/** Implementation **/}
class TextQuestion extends Question {/** Implementation **/}
class SumQuestion extends Question {/** Implementation **/}
Does anybody know the way to convert Question object instance to TextQuestion or SumQuestion object instance?
Something like
$question = new Question();
$sum = (SumQuestion)$question;
Or maybe exists the way that allows replace data from one active record to another?
Aucun commentaire:
Enregistrer un commentaire