Sunday 15 March 2015

php - Access models inside a module from Cron Commands in Yii -



php - Access models inside a module from Cron Commands in Yii -

i want write cron command yii application. know 1 can add together action in protected.commands.

but problem -

i want access models defined in 1 of modules. on running command errors imply models called not accessibly action

i checked console.php in config folder imports models in module.

i don't know if there other settings need done. please enlighten me solution.

console.php

... 'import' => array( 'application.models.*', 'application.modules.glot.models.*', 'application.others.atputils' ), ...

glot module - model

class glotuserbatch extends userbatch { public static function model($classname=__class__) { homecoming parent::model($classname); } public function rules() { homecoming array( array('to_completion', 'safe'), ); } public function relations() { } public function attributelabels() { homecoming array( 'id' => 'id', 'user_id' => 'user', 'batch_id' => 'batch', ); } }

php yii

No comments:

Post a Comment