@param string $designDoc
@param string $name

@return SpatialViewQuery
344803
public function fromSpatial(string $designDoc, string $name): SpatialViewQuery
    {
        return ViewQuery::fromSpatial($designDoc, $name);
    }
1057426
public QueryBuilder useIndex(String designDocument, String indexName) {
        useIndex = new String[]{designDocument, indexName};
        return this;
    }
234725
public function createView($name, $sql = null)
    {
        $view = new View($name, $sql);
        $this->addView($view);

        return $view;
    }
1067401
public function scopeSearch(Builder $query, $name, $userId)
    {
        return $query->where('user_id', '=', $userId)->where('name', '=', $name);
    }
210475
public function addActionCallback($key, $name, $callback = null)
	{
		$this->addActionCheck($key);

		$params = ['__id' => $this->primary_key];

		$this->actions[$key] = $action = new Column\ActionCallback($this, $key, $name, $params);

		if ($callback) {
			if (!is_callable($callback)) {
				throw new DataGridException('ActionCallback callback has to be callable.');
			}

			$action->onClick[] = $callback;
		}

		return $action;
	}
448701
public function addTab($name, $callback = null)
    {
        $item = $this->addTabMenuItem($name);
        $sub = $this->addSubView($item->name);

        // if there is callback action, then use VirtualPage
        if ($callback) {
            $vp = $sub->add(['VirtualPage', 'ui' => '']);
            $item->setPath($vp->getJSURL('cut'));

            $vp->set($callback);
        }

        return $sub;
    }
767684
public static function fetchDocument( $name, $id )
    {
        // Check if a document with the given name exists.
        if ( !isset( self::$documents[$name] ) )
        {
            throw new phpillowNoSuchPropertyException( $name );
        }

        // Instantiate and return document.
        $className = self::$documents[$name];
        $document  = new $className();
        return $document->fetchById( $id );
    }
162250
public function forMember($name, $memberOptions)
	{
		$propertyMap = $this->typeMap->getPropertyMap($name);
		if ($propertyMap === null) {
			throw new PapperConfigurationException(sprintf('Unable to find destination member %s on type %s', $name, $this->typeMap->getDestinationType()));
		}
		$memberOptions = is_array($memberOptions) ? $memberOptions : array($memberOptions);
		foreach ($memberOptions as $memberOption) {
			if (!$memberOption instanceof MemberOptionInterface) {
				throw new PapperConfigurationException('Member options must be array or instance of Papper\MemberOptionInterface');
			}
			$memberOption->apply($this->typeMap, $propertyMap);
		}
		return $this;
	}
856901
public static DesignDocument create(final String name, final List<View> views) {
        return create(name, views, new HashMap<Option, Long>());
    }
581725
protected function getAbstractFileForm($id, $name, $context = [])
    {
        /** @var File $file */
        $file = File::get()->byID($id);

        if (!$file) {
            $this->jsonError(404);
            return null;
        }

        if (!$file->canView()) {
            $this->jsonError(403, _t(
                __CLASS__.'.ErrorItemPermissionDenied',
                "You don't have the necessary permissions to modify {ObjectTitle}",
                [ 'ObjectTitle' => $file->i18n_singular_name() ]
            ));
            return null;
        }

        // Pass to form factory
        $showLinkText = $this->getRequest()->getVar('requireLinkText');
        $augmentedContext = array_merge(
            $context,
            [ 'Record' => $file, 'RequireLinkText' => isset($showLinkText) ]
        );
        $scaffolder = $this->getFormFactory($file);
        $form = $scaffolder->getForm($this, $name, $augmentedContext);

        // Set form action handler with ID included
        $form->setRequestHandler(
            LeftAndMainFormRequestHandler::create($form, [ $id ])
        );

        // Configure form to respond to validation errors with form schema
        // if requested via react.
        $form->setValidationResponseCallback(function (ValidationResult $error) use ($form, $id, $name) {
            $schemaId = Controller::join_links($this->Link('schema'), $name, $id);
            return $this->getSchemaResponse($schemaId, $form, $error);
        });

        return $form;
    }
234503
public function updateSection($id, $name, $identifier)
    {
        try {
            return $this->innerGateway->updateSection($id, $name, $identifier);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
386006
protected function doCreateCollection($name, array $options)
    {
        $this->mongoDB->createCollection($name, $options);

        return $this->doSelectCollection($name);
    }
196937
public function selectPaymentMethodByCode($name)
    {
        if (!isset($this->_paymentMethodsArray))
            throw new Exception("No data loaded");
        foreach ($this->_paymentMethodsArray as $paymentMethod) {
            if ($paymentMethod["PaymentMethodCode"] == strtoupper($name)) {
                $this->_methodData = $paymentMethod;
                break;
            }
        }
        return $this;
    }
275546
public function callScopeFunction($name, ...$args)
    {
        if (is_string($name) && method_exists($this->model, $method = Str::camel('scope_'.$name))) {
            return $this->model->$method($this, ...$args);
        }

        if (is_callable($name)) {
            return tap($this, function () use ($name) {
                call_user_func($name, $this);
            });
        }

        throw new BadMethodCallException('Scope method could not be resolved: '.$method);
    }
553323
public function view(string $name, array $data = [])
    {
        return $this->add(View::create($name, $data));
    }
478189
public function findById($name, $id) {
        $this->load();
        $mapper = MapperBuilder::buildFromName($this->mapping, $name);

        $newEntity = NULL;

        $query = "SELECT * FROM `" . $mapper->getTable() . "` WHERE id = :id";

        $result = $this->getDataSource()->query($query, array(":id" => $id));

        if ($result) {
            $newEntity = $mapper->createObject($result[0]);

            /* relations */
            foreach ($mapper->getRelations() as $relation) {

                /* only set relations if not lazy */
                if (!$relation->isLazy()) {
                    $relMapper = MapperBuilder::buildFromName($this->mapping, $relation->getEntity());

                    $queryRel = QueryBuilder::buildSelectRelation($relation, $relMapper);

                    $resRel = $this->getDataSource()->query($queryRel, array(":id" => $newEntity->getId()));

                    $method = "set" . $relation->getName();
                    if ($resRel) {
                        $collection = new Collection($relMapper->getClass(), $resRel, $relMapper);
                    } else {
                        $collection = new Collection($relMapper->getClass(), array(), $relMapper);
                    }
                    $newEntity->$method($collection);
                }
            }
        }
        return $newEntity;
    }
768905
public function if($name, callable $callback)
    {
        $this->conditions[$name] = $callback;

        $this->directive($name, function ($expression) use ($name) {
            return $expression !== ''
                    ? "<?php if (\Illuminate\Support\Facades\Blade::check('{$name}', {$expression})): ?>"
                    : "<?php if (\Illuminate\Support\Facades\Blade::check('{$name}')): ?>";
        });

        $this->directive('else'.$name, function ($expression) use ($name) {
            return $expression !== ''
                ? "<?php elseif (\Illuminate\Support\Facades\Blade::check('{$name}', {$expression})): ?>"
                : "<?php elseif (\Illuminate\Support\Facades\Blade::check('{$name}')): ?>";
        });

        $this->directive('end'.$name, function () {
            return '<?php endif; ?>';
        });
    }