Busca por campos mult relacionais que precisam ser selecionados

@param Meta $meta
@param Dicionario $dicionario
@return string
190596
private function checkSelecaoUnique(Meta $meta): string
    {
        $mult = "";

        $tpl = new \Helpers\Template("form");
        foreach ($meta->getSelect() as $select) {

            if (!empty($select->getValue())) {
                $dr = new Dicionario($select->getRelation());
                $dr->setData($select->getValue());
                $tplData = array_merge($select->getDados(), ["title" => $dr->getRelevant()->getValue(), "id" => $select->getValue()]);
            } else {
                $tplData = array_merge($select->getDados(), ["title" => "", "id" => ""]);
            }

            $tplData['nome'] = preg_match('/s$/i', $select->getNome()) ? substr($select->getNome(), 0, strlen($select->getNome()) - 1) : $select->getNome();
            $tplData['genero'] = preg_match('/a$/i', $select->getNome()) ? "a" : "o";
            $tplData['parentColumn'] = $meta->getColumn();
            $tplData['parentValue'] = $meta->getValue() ? 1 : "";
            $tplData['column'] = $select->getColumn();
            $tplData['ngmodel'] = "dados." . $select->getColumn();
            $tplData['entity'] = $meta->getRelation();

            $mult .= $tpl->getShow("selecaoUnique", $tplData);
        }

        return $mult;
    }
617923
public function __metaToString(): string {
        $tmp = $this->metadata->getGraph()->serialise('ntriples');
        return "\n" . str_replace($this->uri, '', $tmp) . "\n";
    }
441475
protected function metaKeyIsRegex($meta)
    {
        if (!isset($meta['meta_key'])) {
            return false;
        }

        return $this->pregMatchArray($meta['meta_key'], $this->regex);
    }
292681
private function __metaToData()
    {
        $strReturn = "";

        if (isset($this->__meta["data"]) && is_array($this->__meta["data"])) {
            foreach ($this->__meta["data"] as $strKey => $strValue) {
                $strReturn .= "data-" . strtolower($strKey) . "=\"" . $strValue . "\" ";
            }
        }

        return $strReturn;
    }
989404
public function metaTitle()
    {
        $context = $this->contextObject();
        $title   = null;

        if ($context instanceof HasMetatagInterface) {
            $title = (string)$context['meta_title'];
        }

        if (!$title) {
            $title = (string)$this->fallbackMetaTitle();
        }

        return $title;
    }
466028
private function defaultDicionarioData()
    {
        $this->dicionario = [];
        if ($dicEntity = Metadados::getDicionario($this->entity, !0, !0)) {
            foreach ($dicEntity as $i => $meta)
                $this->dicionario[$i] = new Meta(array_merge(['id' => $i], $meta), $this->defaultMeta['default']);
        }
    }
405441
protected function getMetadata()
    {
        if (null == $this->metaProvider) {
            $this->metaProvider = App::make('metadata');
        }
        return $this->metaProvider;
    }
515688
protected function transformByMeta(string $meta, array $data, ...$parameters): array
    {
        $name = Str::singular($meta);
        $types = $this->options[$meta];

        if (empty($types)) {
            return $data;
        }

        foreach ($types as $type => $index) {
            if (is_array($type)) {
                continue;
            }

            $method = $name.Str::studly($type);

            if (method_exists($this, $method)) {
                $data = $this->{$method}($data, ...$parameters);
            }
        }

        return $data;
    }
522754
private static function checkSize(Meta $m)
    {
        if ($m->getSize()) {
            $length = strlen($m->getValue());
            if ($m->getType() === "varchar" && $length > $m->getSize())
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "char" && $length > 1)
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "tinytext" && ($length > 255 || $length > $m->getSize()))
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "text" && ($length > 65535 || $length > $m->getSize()))
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "mediumtext" && ($length > 16777215 || $length > $m->getSize()))
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "longtext" && ($length > 4294967295 || $length > $m->getSize()))
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "tinyint" && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(8)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));

            elseif ($m->getType() === "smallint" && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(16)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));

            elseif ($m->getType() === "mediumint" && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(24)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));

            elseif ($m->getType() === "int" && !in_array($m->getKey(), ["extend", "extend_add", "list", "list_mult", "selecao", "selecao_mult", "checkbox_rel", "extend_mult", "checkbox_mult"]) && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(32)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));

            elseif ($m->getType() === "bigint" && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(64)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));
        }
    }
1316147
public function whereAnyMeta(array $metas)
	{
		$filters = array();
		
		foreach ($metas as $meta => $data) {
			$value = is_array($data) ? Arr::get($data, 0) : $data;
			$operator = is_array($data) ? Arr::get($data, 1, '=') : '=';
			
			if (is_object($meta)) {
				$filters[] = array('id' => $meta->id, 'value' => $value, 'operator' => $operator);
			}
			else {
				$filters[] = array('name' => $meta, 'value' => $value, 'operator' => $operator);
			}
		}
		
		$this->filters[]['metas'] = $filters;
		
		return $this;
	}
736720
public function updateDataMetaObj( $model, $meta ) {

		$model->updateDataMeta( $meta->key, $meta->value );

		$model->refresh();

		return $model;
	}
1157089
public function metadataIdent()
    {
        if ($this->metadataIdent === null) {
            $this->metadataIdent = $this->generateMetadataIdent();
        }
        return $this->metadataIdent;
    }
1003147
public function renderMeta(ArticleMeta $meta)
    {
        /** @var \Twig_Template $template */
        $template = $this->environment->loadTemplate('VinceCmsBundle::meta.html.twig');
        $blockname = str_ireplace(array(':', '-'), array('_', '_'), Inflector::tableize($meta->getMeta()->getName())).'_meta';
        if ($template->hasBlock($blockname)) {
            return $template->renderBlock($blockname, array(
                    'name' => $meta->getMeta()->getName(),
                    'contents' => $meta->getContents(),
                )
            );
        }

        return $template->renderBlock('meta', array(
                'name' => $meta->getMeta()->getName(),
                'contents' => $meta->getContents(),
            )
        );
    }
532008
public function ask(MetaDataSource $metadataSource, $choice = null)
    {
        $metaDataCollection = $this->getMetadataDao($metadataSource)->getAllMetadata();
        $responseCollection = new PredefinedResponseCollection();

        foreach ($metaDataCollection as $metaData) {
            $response = new PredefinedResponse($metaData->getOriginalName(), $metaData->getOriginalName(), $metaData);
            $response->setAdditionalData(array('source' => $metadataSource->getUniqueName()));

            $responseCollection->append($response);
        }

        $question = new QuestionWithPredefinedResponse(
            "Select Metadata",
            self::QUESTION_KEY,
            $responseCollection
        );
        $question->setPreselectedResponse($choice);
        $question->setShutdownWithoutResponse(true);

        return $this->context->askCollection($question);
    }
1110930
private function getBody(Metadata $meta, array $entities)
    {
        $body = new Body();

        $configuration = $meta->getConfiguration();
        $mappings = $meta->getMappings();

        foreach ($entities as $entity) {
            $bodyRow = new BodyRow($this->buildBodyRowAttr($entity, $meta));

            if (!empty($configuration['view']['index']['action_widgets'])) {
                $actionWidgets = '';

                foreach ($configuration['view']['index']['action_widgets'] as $widgetAlias => $widgetOptions) {
                    $actionWidgets .= $this->widgetPool->getWidget($widgetAlias)->getContent(
                        $entity,
                        $widgetOptions
                    );
                }

                $bodyRow->addItem('action_widgets', new BodyRowItem($actionWidgets));
            }
            foreach ($configuration['view']['index']['fields'] as $field => $params) {
                if ($this->fieldBlacklistManager->isFieldBlacklisted($meta, $field, '[view][index]')) {
                    continue;
                }

                $content = null;

                if (!$this->isFieldContentHidden($params, $entity)) {
                    if (!$this->isPropertyViewField($meta, 'index', $field)
                        || !array_key_exists($field, $configuration['form']['index']['fields'])
                        || $this->fieldBlacklistManager->isFieldBlacklisted($meta, $field, '[view][index]')
                        || $this->fieldBlacklistManager->isFieldBlacklisted($meta, $field, '[form][index]')
                    ) {
                        $content = $this->getFieldContent($entity, $field, $params, $mappings);
                    } else {
                        $form = $this->adminFormFactory->createPropertyForm($meta, $field, $entity);

                        $content = $this->renderPropertyForm($form, $entity, $meta->getEntityClass(), $field);
                    }
                }

                $bodyRow->addItem($field, new BodyRowItem($content, $this->buildBodyRowItemAttr($field, $params['attr'], $meta)));
            }

            $body->addRow($bodyRow);
        }

        $this->normalizeBody($body);

        return $body;
    }
1207635
public function withMeta($meta)
	{
		foreach (func_get_args() as $arg) {
			$metas = ($arg instanceof Collection) ? $arg->all() : is_array($arg) ? $arg : array($arg);
			
			foreach ($metas as $m) {
				if (is_object($m)) {
					$this->filters[]['metas'][] = array('id' => $m->id);
				}
				else {
					$this->filters[]['metas'][] = array('name' => $m);
				}
			}
		}
		
		return $this;
	}
302587
public function getMeta()
    {
        $meta = $this->unitOfWork->getEntityRegistry()->getEntityBuilder()->getMeta($this->className);

        return $meta;
    }