S
S
Sergey Pribylskiy2014-09-08 21:36:45
Yii
Sergey Pribylskiy, 2014-09-08 21:36:45

Yii + PhpStorm = autocomplete, how to set up?

Goodnight!
PhpStorm is configured to work with Yii, all methods are picked up, but when scopes are set in the model, they are not supplemented when requested from the controller:

Model
....
 public function scopes()
    {
        return array(
            // slider
            'mainpage' => array(
                'condition' => 'mainpage=1',
                'select' => 'obj_id,lat,lon,head,idname,description, finished,address,finished,tip',
                'order' => 'ord'
            ),
            'commercial' => array(
                'condition' => 'commercial=1'
            ),
            'noncommercial' => array(
                'condition' => 'commercial=0'
            ),
        );
    }
......
Controller
$objects = Object::model()->noncommercial()->findAll($criteria);

After model()->there is no noncommercial add-on option (and others from scopes too), how can this be fixed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Zelenin, 2014-09-08
@ASP

manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDoc...

/**
* @method Object mainpage()
*/
class Object
{
...
}

K
Konstantin Andreevich, 2014-09-08
@reffy

With phpdoc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question