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;
    }
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;
    }
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 ; }
Busca por campos mult relacionais que precisam ser selecionados

@param Meta $meta
@param Dicionario $dicionario
@return string
Busca por campos mult relacionais que precisam ser selecionados