0
I am trying to make a somewhat abstract method that will execute a yii2 query depending on the attribute passed my code is:
public static function getModelosQuePodemTer($atributo) {
    self::$helper = $atributo;
    return self::find()
                ->joinWith(['modelo' => function($query) {
                        $query->andWhere([self::$helper => 1]);
                    }])
                ->all();
If I’m not mistaken I can not pass another attribute in the function being called, and I believe that my solution is a gambiarra
I wonder if there’s another way to do that
Thanks :) worked right
– Fernando Carvalho
Boaa! for nothing =]
– arllondias