Hi,
I’d like to create a Yii console command. It’s about database maintenance. The logic is kind of complex, impossible to implement in one function (an action or the run-method). Therefore, I need to store some logic in separate functions. But it seems I cannot call functions from withing the run-method, e.g.:
<?php
class MyCommand extends CConsoleCommand
{
public function run($args)
{
// The next line causes...
// Fatal error: Call to undefined function myHelperFunction()
myHelperFunction();
}
public function myHelperFunction()
{
echo "myHelperFunction";
}
}
?>
Can anyone explain me why?
Thanks.