@param string $context

@return ProxyQueryInterface
178887
public function createQuery($context = 'list')
    {
        $query = $this->getModelManager()->createQuery($this->getClass());
        $query->setRootPath($this->getRootPath());

        foreach ($this->extensions as $extension) {
            $extension->configureQuery($this, $query, $context);
        }

        return $query;
    }
394984
protected function proxy() {
        if (!$this->context) {
            $this->context = new ApplicationContext(
                $this->version,
                $this->solution['accountSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
573359
public function getBatchObjects($class, ProxyQueryInterface $queryProxy)
    {
        $queryProxy->select('DISTINCT '.$queryProxy->getRootAlias());

        return $queryProxy->getQuery()->execute();
    }
840495
public function fetchEntity(AnCommandContext $context)
    {
        if ($this->isDispatched() && $this->getRequest()->alias) {
            $this->setIdentifiableKey('alias');
        }

        return parent::fetchEntity($context);
    }
67102
public function context($context = null)
    {
        if (is_null($context) || empty($context) || $context == "this") {
            $context = null;
        } else {
            $this->__contextAwareContext = $context;
        }
        return $this;
    }
934705
public static function createProxyInstance(string $class)
    {
        if (!isset(self::$proxyCache[$class])) {
            $reflection = new \ReflectionClass($class);

            if (!$reflection->isAbstract()) {
                return $reflection->newInstanceWithoutConstructor();
            }

            $proxyNamespace = '__Proxies';
            $proxyName      = str_replace('\\', '_', $reflection->getName()) . self::$count++;
            $baseClass      = $class;
            $methods        = [];

            foreach ($reflection->getMethods(\ReflectionMethod::IS_ABSTRACT) as $method) {
                $methods[] = self::buildMethod($method);
            }

            $methods = implode(PHP_EOL, $methods);

            $classString = <<<PHP
namespace {$proxyNamespace};

class {$proxyName} extends \\{$baseClass} {
    {$methods}
}
PHP;
            eval($classString);
            self::$proxyCache[$class] = (new \ReflectionClass($proxyNamespace . '\\' . $proxyName))->newInstanceWithoutConstructor();
        }

        return clone self::$proxyCache[$class];
    }
171052
public function createQuery($context = 'list')
    {
        $query = parent::createQuery($context);
        $query->leftJoin($query->getRootAlias().'.article', 'article')->addSelect('article')
              ->leftJoin($query->getRootAlias().'.parent', 'parent')->addSelect('parent')
              ->leftJoin($query->getRootAlias().'.children', 'children')->addSelect('children')
              ->orderBy($query->getRootAlias().'.root, '.$query->getRootAlias().'.lft', 'ASC');

        return $query;
    }
159583
protected function proxy() {
        if (!$this->context) {
            $this->context = new VariableContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['environmentSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
1048609
protected function proxy() {
        if (!$this->context) {
            $this->context = new ExecutionContext(
                $this->version,
                $this->solution['flowSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
1184933
protected function proxy() {
        if (!$this->context) {
            $this->context = new BindingContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
718277
public function setProxy(string $proxy): RequestContext
    {
        $this->assertValidUrl($proxy);

        $this->proxy = $proxy;

        return $this;
    }
340287
protected function proxy() {
        if (!$this->context) {
            $this->context = new AvailableAddOnContext($this->version, $this->solution['sid']);
        }

        return $this->context;
    }
869253
public function getDBQueryBuilder(Context $context = null)
    {
        if ($this->dbQueryBuilder == null) {
            $this->dbQueryBuilder            = new Miner();
        }
        $this->dbQueryBuilder->context = $context;

        return $this->dbQueryBuilder;
    }
1154420
protected function proxy() {
        if (!$this->context) {
            $this->context = new SyncStreamContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
134988
public function getContext(ModelContextInterface $context = null)
    {
        $context = new ModelContext($context);
        $context->setState($this->getState());
        $context->setIdentityKey($this->_identity_key);

        return $context;
    }
735819
protected function proxy() {
        if (!$this->context) {
            $this->context = new InviteContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['channelSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
777446
public function fetchEntity(AnCommandContext $context)
    {
        if (!$this->_entity) {
            if ($entity = $this->getService('com:settings.domain.entity.template')->load($this->alias)) {
                $this->_entity = $entity;
            }
        }

        return $this->_entity;
    }