oncesk / yii-node-socket

66 stars 46 forks source link

CModel not found #84

Open BrainFeeder opened 7 years ago

BrainFeeder commented 7 years ago

The AModel extends from \CModel but I can not find it anywhere :) I get the error

{
  "name": "PHP Fatal Error",
  "message": "Class 'CModel' not found",
  "code": 1,
  "type": "yii\\base\\ErrorException",
  "file": "C:\\wamp\\www\\prx\\vendor\\oncesk\\yii-node-socket\\lib\\php\\models\\AModel.php",
  "line": 10,
  "stack-trace": [
    "#0 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\BaseYii.php(0): yii\\BaseYii::autoload()",
    "#1 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\BaseYii.php(4): ::spl_autoload_call()",
    "#2 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\BaseYii.php(288): ::unknown()",
    "#3 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\base\\Object.php(0): yii\\BaseYii::autoload()",
    "#4 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\base\\Object.php(127): ::spl_autoload_call()",
    "#5 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\base\\Object.php(134): YiiNodeSocket\\Behaviors\\ArChannel->getChannel()",
    "#6 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\db\\BaseActiveRecord.php(139): yii\\base\\Object->__get()",
    "#7 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\db\\BaseActiveRecord.php(286): yii\\base\\Component->__get()",
    "#8 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\base\\Component.php(95): yii\\db\\BaseActiveRecord->__get()",
    "#9 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\base\\Component.php(132): api\\modules\\v1\\models\\Profile->getChannelName()",
    "#10 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\db\\BaseActiveRecord.php(286): yii\\base\\Component->__get()",
    "#11 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\rest\\Serializer.php(120): yii\\db\\BaseActiveRecord->__get()",
    "#12 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\rest\\Serializer.php(259): yii\\base\\Model->toArray()",
    "#13 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\rest\\Serializer.php(150): yii\\rest\\Serializer->serializeModel()",
    "#14 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\rest\\Controller.php(99): yii\\rest\\Serializer->serialize()",
    "#15 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\rest\\Controller.php(77): yii\\rest\\Controller->serializeData()",
    "#16 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\base\\Controller.php(158): yii\\rest\\Controller->afterAction()",
    "#17 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\base\\Module.php(523): yii\\base\\Controller->runAction()",
    "#18 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\web\\Application.php(102): yii\\base\\Module->runAction()",
    "#19 C:\\wamp\\www\\prx\\vendor\\yiisoft\\yii2\\base\\Application.php(380): yii\\web\\Application->handleRequest()",
    "#20 C:\\wamp\\www\\prx\\api\\web\\index.php(18): yii\\base\\Application->run()",
    "#21 {main}"
  ]
}

When I try to save a model with Yii rest ActiveController & ActiveModel

oncesk commented 7 years ago

So, it seems like not all code was refactored, CModel and CModelEvent used in Yii 1, as i know in Yii 2 exists Model class and ModelEvent

Will be cool if you refactor and create pull request, i am sorry but i can not do it myself :(

Thank you.

2017-02-10 14:52 GMT+03:00 Robrecht Wellens notifications@github.com:

The AModel extends from \CModel but I can not find it anywhere :) I get the error

{ "name": "PHP Fatal Error", "message": "Class 'CModel' not found", "code": 1, "type": "yii\base\ErrorException", "file": "C:\wamp\www\prx\vendor\oncesk\yii-node-socket\lib\php\models\AModel.php", "line": 10, "stack-trace": [ "#0 C:\wamp\www\prx\vendor\yiisoft\yii2\BaseYii.php(0): yii\BaseYii::autoload()", "#1 C:\wamp\www\prx\vendor\yiisoft\yii2\BaseYii.php(4): ::spl_autoload_call()", "#2 C:\wamp\www\prx\vendor\yiisoft\yii2\BaseYii.php(288): ::unknown()", "#3 C:\wamp\www\prx\vendor\yiisoft\yii2\base\Object.php(0): yii\BaseYii::autoload()", "#4 C:\wamp\www\prx\vendor\yiisoft\yii2\base\Object.php(127): ::spl_autoload_call()", "#5 C:\wamp\www\prx\vendor\yiisoft\yii2\base\Object.php(134): YiiNodeSocket\Behaviors\ArChannel->getChannel()", "#6 C:\wamp\www\prx\vendor\yiisoft\yii2\db\BaseActiveRecord.php(139): yii\base\Object->get()", "#7 C:\wamp\www\prx\vendor\yiisoft\yii2\db\BaseActiveRecord.php(286): yii\base\Component->get()", "#8 C:\wamp\www\prx\vendor\yiisoft\yii2\base\Component.php(95): yii\db\BaseActiveRecord->get()", "#9 C:\wamp\www\prx\vendor\yiisoft\yii2\base\Component.php(132): api\modules\v1\models\Profile->getChannelName()", "#10 C:\wamp\www\prx\vendor\yiisoft\yii2\db\BaseActiveRecord.php(286): yii\base\Component->get()", "#11 C:\wamp\www\prx\vendor\yiisoft\yii2\rest\Serializer.php(120): yii\db\BaseActiveRecord->__get()", "#12 C:\wamp\www\prx\vendor\yiisoft\yii2\rest\Serializer.php(259): yii\base\Model->toArray()", "#13 C:\wamp\www\prx\vendor\yiisoft\yii2\rest\Serializer.php(150): yii\rest\Serializer->serializeModel()", "#14 C:\wamp\www\prx\vendor\yiisoft\yii2\rest\Controller.php(99): yii\rest\Serializer->serialize()", "#15 C:\wamp\www\prx\vendor\yiisoft\yii2\rest\Controller.php(77): yii\rest\Controller->serializeData()", "#16 C:\wamp\www\prx\vendor\yiisoft\yii2\base\Controller.php(158): yii\rest\Controller->afterAction()", "#17 C:\wamp\www\prx\vendor\yiisoft\yii2\base\Module.php(523): yii\base\Controller->runAction()", "#18 C:\wamp\www\prx\vendor\yiisoft\yii2\web\Application.php(102): yii\base\Module->runAction()", "#19 C:\wamp\www\prx\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest()", "#20 C:\wamp\www\prx\api\web\index.php(18): yii\base\Application->run()", "#21 {main}" ] }

When I try to save a model with Yii rest ActiveController & ActiveModel

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oncesk/yii-node-socket/issues/84, or mute the thread https://github.com/notifications/unsubscribe-auth/AB84jEpy7sMWQ3fT9cQESe__YpvEPW1Eks5rbE9jgaJpZM4L9TLT .

BrainFeeder commented 7 years ago

I'm on a thight shedule myself, but since I would really like to use this in the project seems I've no choice ;) I'll see what I can come up with and get back to you when I can get it working.