I have a model generated as Parent from Yii.
class Parent extends AppModel {}
When I used it as follows, I got an error.
$parent = new Parent();
Fatal error: Cannot use 'Parent' as class name as it is reserved in E:\Customer\Qelasy\Project\QelasySecurity\web\SourceCode\protected\modules\user\models\Parent.php on line 14
As I understand, this is because Parent
is a keyword in PHP, and Yii has generated this. Is there any workaround to make it work with Parent
without changing the model name into Parents?