components/Interpreter.php
protected function pushMissingInterpretations($availables, $data = null)
    {
        /* @var $secondaryModel \yii\db\ActiveRecord */
        $secondaryModel = new $this->relSecondary->modelClass;

        $queryModel = $secondaryModel->find();

        $restriction = $this->_getRestriction($data, $this->_getPrimaryKeyName($secondaryModel));

        $viaRestriction = ArrayHelper::remove($restriction, $this->relSecondaryKey, false);

        if (false !== $viaRestriction) {
            $restriction[$this->_getPrimaryKeyName($secondaryModel)] = $viaRestriction;
        }

        if ($restriction) {
            $queryModel->where($restriction);
        }

        foreach ($queryModel->all() as $secondary) {
            if (!isset($availables[$secondary->primaryKey])) {
                $availables[$secondary->primaryKey] = $this->_createInterpretation($secondary->primaryKey);
            }
        }

        ksort($availables);

        return $availables;
    }
protected function pushMissingInterpretations($availables, $data = null)
    {
        /* @var $secondaryModel \yii\db\ActiveRecord */
        $secondaryModel = new $this->relSecondary->modelClass;

        $queryModel = $secondaryModel->find();

        $restriction = $this->_getRestriction($data, $this->_getPrimaryKeyName($secondaryModel));

        $viaRestriction = ArrayHelper::remove($restriction, $this->relSecondaryKey, false);

        if (false !== $viaRestriction) {
            $restriction[$this->_getPrimaryKeyName($secondaryModel)] = $viaRestriction;
        }

        if ($restriction) {
            $queryModel->where($restriction);
        }

        foreach ($queryModel->all() as $secondary) {
            if (!isset($availables[$secondary->primaryKey])) {
                $availables[$secondary->primaryKey] = $this->_createInterpretation($secondary->primaryKey);
            }
        }

        ksort($availables);

        return $availables;
    }
protected function pushMissingInterpretations ( $ availables , $ data = null ) { /* @var $secondaryModel \yii\db\ActiveRecord */ $ secondaryModel = new $ this -> relSecondary -> modelClass ; $ queryModel = $ secondaryModel -> find ( ) ; $ restriction = $ this -> _getRestriction ( $ data , $ this -> _getPrimaryKeyName ( $ secondaryModel ) ) ; $ viaRestriction = ArrayHelper :: remove ( $ restriction , $ this -> relSecondaryKey , false ) ; if ( false !== $ viaRestriction ) { $ restriction [ $ this -> _getPrimaryKeyName ( $ secondaryModel ) ] = $ viaRestriction ; } if ( $ restriction ) { $ queryModel -> where ( $ restriction ) ; } foreach ( $ queryModel -> all ( ) as $ secondary ) { if ( ! isset ( $ availables [ $ secondary -> primaryKey ] ) ) { $ availables [ $ secondary -> primaryKey ] = $ this -> _createInterpretation ( $ secondary -> primaryKey ) ; } } ksort ( $ availables ) ; return $ availables ; }
Default method for getting all owner's possible hasMany relation models.
This can be overloaded and changed in owner's model class.
Default method for getting all owner s possible hasMany relation models . This can be overloaded and changed in owner s model class .