public function queryset($modelInstance, $reverse = true)
    {
        if ($reverse) {
            $model = $this->field->getRelatedModel();
        } else {
            $model = $this->field->scopeModel;
        }

        // define BaseM2MQueryset
        if (!class_exists('\Eddmash\PowerOrm\Model\Manager\BaseM2OManager', false)) {
            $baseClass = $model::getManagerClass();
            $class = sprintf('namespace Eddmash\PowerOrm\Model\Manager;class BaseM2OManager extends \%s{}', $baseClass);
            eval($class);
        }

        $manager = M2OManager::createObject(
            [
                'model' => $model,
                'rel' => $this->field->relation,
                'instance' => $modelInstance,
                'reverse' => $reverse,
            ]
        );

        return $manager;
    }
public function queryset($modelInstance, $reverse = true)
    {
        if ($reverse) {
            $model = $this->field->getRelatedModel();
        } else {
            $model = $this->field->scopeModel;
        }

        // define BaseM2MQueryset
        if (!class_exists('\Eddmash\PowerOrm\Model\Manager\BaseM2OManager', false)) {
            $baseClass = $model::getManagerClass();
            $class = sprintf('namespace Eddmash\PowerOrm\Model\Manager;class BaseM2OManager extends \%s{}', $baseClass);
            eval($class);
        }

        $manager = M2OManager::createObject(
            [
                'model' => $model,
                'rel' => $this->field->relation,
                'instance' => $modelInstance,
                'reverse' => $reverse,
            ]
        );

        return $manager;
    }
public function queryset ( $ modelInstance , $ reverse = true ) { if ( $ reverse ) { $ model = $ this -> field -> getRelatedModel ( ) ; } else { $ model = $ this -> field -> scopeModel ; } // define BaseM2MQueryset if ( ! class_exists ( '\Eddmash\PowerOrm\Model\Manager\BaseM2OManager' , false ) ) { $ baseClass = $ model :: getManagerClass ( ) ; $ class = sprintf ( 'namespace Eddmash\PowerOrm\Model\Manager;class BaseM2OManager extends \%s{}' , $ baseClass ) ; eval ( $ class ) ; } $ manager = M2OManager :: createObject ( [ 'model' => $ model , 'rel' => $ this -> field -> relation , 'instance' => $ modelInstance , 'reverse' => $ reverse , ] ) ; return $ manager ; }
Creates the queryset to retrieve data for the relationship that relates to this field.

@param      $modelInstance
@param bool $reverse

@internal param $modelName

@return Queryset

@author   : Eddilbert Macharia (http://eddmash.com)<edd.cowan@gmail.com>
Creates the queryset to retrieve data for the relationship that relates to this field .