public function listByFilter($filter) { $criteria = $this->getCriteria()->select('idFrame, entry, active, idEntity, entries.name as name')->orderBy('entries.name'); Base::entryLanguage($criteria); if ($filter->idFrame) { $criteria->where("idFrame = {$filter->idFrame}"); } if ($filter->frame) { $criteria->where("entries.name LIKE '{$filter->frame}%'"); } if ($filter->lu) { $criteria->distinct(true); $criteria->where("lus.name LIKE '{$filter->lu}%'"); } if ($filter->idLU) { if (is_array($filter->idLU)) { $criteria->where("lus.idLU", "IN", $filter->idLU); } else { $criteria->where("lus.idLU = {$filter->idLU}"); } } if ($filter->fe) { $criteria->distinct(true); $criteria->associationAlias("fes.entries", "feEntries"); Base::entryLanguage($criteria, "feEntries."); $criteria->where("feEntries.name LIKE '{$filter->fe}%'"); } return $criteria; }
public function listForEditor($idEntityCxn) { $criteria = $this->getCriteria()->select('idEntity,entries.name as name')->orderBy('entries.name'); Base::entryLanguage($criteria); Base::relation($criteria, 'constructionelement', 'construction', 'rel_elementof'); $criteria->where("construction.idEntity = {$idEntityCxn}"); return $criteria; }
public function listAnnotationStatus($filter) { $criteria = $this->getCriteria()->select('idTypeInstance as idAnnotationStatus, entry, entries.name as name, idColor, color.name as colorName, color.rgbFg, color.rgbBg')->orderBy('entry'); Base::entryLanguage($criteria); $criteria->where("entry like 'ast_%'"); if ($filter->entry) { $criteria->where("entry LIKE '{$filter->entry}%'"); } return $criteria; }
public function listByCorpus($idCorpus) { $criteria = $this->getCriteria()->select('idDocument, entry, entries.name as name, count(paragraphs.sentences.idSentence) as quant')->orderBy('entries.name'); $criteria->setAssociationType('paragraphs.sentences', 'left'); $criteria->setAssociationType('paragraphs', 'left'); Base::entryLanguage($criteria); $criteria->where("idCorpus = {$idCorpus}"); $criteria->groupBy("idDocument, entry, entries.name"); return $criteria; }
public function listCE() { $ce = new ConstructionElement(); $criteria = $ce->getCriteria()->select('idConstructionElement, entry, entries.name as name, color.rgbFg, color.rgbBg, color.idColor'); Base::entryLanguage($criteria); Base::relation($criteria, 'constructionelement', 'construction', 'rel_elementof'); $criteria->where("construction.idConstruction = {$this->getId()}"); $criteria->orderBy('entries.name'); return $criteria; }
public function getInstantiationType($entry = '') { $criteria = $this->getCriteria(); $criteria->select("typeinstances.idTypeInstance as idInstantiationType, typeinstances.entries.name as instantiationType"); $criteria->where("entry = 'typ_instantiationtype'"); if ($entry != '') { $criteria->where("typeinstances.entry = '{$entry}'"); } Base::entryLanguage($criteria, 'typeinstances'); return $criteria; }
public function listLUByWordForm($wordform) { $criteria = $this->getCriteria(); $criteria->select('lexeme.lexemeentries.lemma.lus.idLU'); $criteria->where("upper(form) = upper('{$wordform}')"); $lus = $criteria->asQuery()->chunkResult('idLU', 'idLU'); if (count($lus) > 0) { $lu = new LU(); $criteria = $lu->getCriteria()->select("idLU, concat(frame.entries.name,'.',name) as fullName"); Base::relation($criteria, 'lu', 'frame', 'rel_evokes'); Base::entryLanguage($criteria, 'frame'); $criteria->where("idLU", "IN", $lus); $criteria->where("lemma.idLanguage", "=", "frame.entries.idLanguage"); return $criteria->asQuery()->chunkResult('idLU', 'fullName'); } else { return new \stdClass(); } }
public function listByFilter($filter) { $criteria = $this->getCriteria()->select('idCorpus, entry, entries.name as name')->orderBy('entries.name'); Base::entryLanguage($criteria); if ($filter->idCorpus) { $criteria->where("idCorpus = '{$filter->idCorpus}'"); } if ($filter->corpus) { $criteria->where("upper(entries.name) LIKE upper('%{$filter->corpus}%')"); } if ($filter->entry) { $criteria->where("upper(entry) LIKE upper('%{$filter->entry}%')"); } if ($filter->document) { Base::entryLanguage($criteria, 'documents'); $criteria->where("upper(documents.entries.name) LIKE upper('%{$filter->document}%')"); } return $criteria; }
public function listByGroup() { $criteria = $this->getCriteria()->select('idLayerType, entries.name name')->orderBy('idLayerGroup, entries.name'); Base::entryLanguage($criteria); return $criteria; }
public function listCoreForEditor($idEntityFrame) { $criteria = $this->getCriteria()->select('idEntity,entries.name as name')->orderBy('entries.name'); Base::entryLanguage($criteria); Base::relation($criteria, 'frameelement', 'typeinstance', 'rel_hastype'); Base::relation($criteria, 'frameelement', 'frame', 'rel_elementof'); $criteria->where("typeinstance.entry = 'cty_core'"); $criteria->where("frame.idEntity = {$idEntityFrame}"); return $criteria; }
public function getLayers($idSentence) { $criteria = $this->getCriteria(); $criteria->select('layers.idLayer, layers.layertype.entries.name as name, idAnnotationSet'); $criteria->where("idSentence = {$idSentence}"); if (!\Manager::checkAccess('MASTER', A_EXECUTE)) { $criteria->where("idAnnotationSet = {$this->getId()}"); } Base::entryLanguage($criteria, 'layers.layertype'); return $criteria->asQuery()->getResult(); }
public function getStats() { $criteria = $this->getCriteria()->select('annotationsets.annotationStatus.entry, annotationsets.annotationStatus.entries.name, count(*) as quant')->where("idSubCorpus = {$this->getId()}")->groupBy('annotationsets.annotationStatus.entry', 'annotationsets.annotationStatus.entries.name'); Base::entryLanguage($criteria, 'annotationsets.annotationStatus'); $result = (object) $criteria->asQuery()->getResult(); return $result; }
public function getBaseFrame() { // if template was created from a frame, this frame is the "base frame" $frame = new Frame(); $criteria = $frame->getCriteria()->select('idFrame, entries.name as name, entries.description as description')->orderBy('entries.name'); Base::relation($criteria, 'template', 'frame', 'rel_createdfrom'); $criteria->where("template.idEntity = {$this->getIdEntity()}"); Base::entryLanguage($criteria); return $criteria; }
public function listAll() { $criteria = $this->getCriteria()->select('idDomain, entries.name as name')->orderBy('entries.name'); Base::entryLanguage($criteria); return $criteria; }
public function listForConstraint($array) { $idLanguage = \Manager::getSession()->idLanguage; $criteria = $this->getCriteria()->select("idLU as del, idLU, concat(frame.entries.name,'.',name) as fullname")->orderBy('frame.entries.name,name'); $criteria->where("idLU", "IN", $array); Base::relation($criteria, 'lu', 'frame', 'rel_evokes'); Base::entryLanguage($criteria, 'frame'); $criteria->where("lemma.idLanguage = {$idLanguage}"); return $criteria; }
public function listForCombo() { $criteria = $this->getCriteria()->select('idPOS, entry.name as name')->orderBy('entry.name'); Base::entryLanguage($criteria); return $criteria; }
public function listAll() { $criteria = $this->getCriteria()->select('idRelationType, entry, nameEntity1, nameEntity2, entries.name as name')->orderBy('entries.name'); Base::entryLanguage($criteria); return $criteria; }
public function listTypesByEntity($idEntity) { $domain = new Domain(); $domainCriteria = $domain->getCriteria()->select('domain.idDomain, domain.entries.name as domainName')->setAlias('d'); Base::entryLanguage($domainCriteria, 'domain'); $criteria = Base::relationCriteria('entity', 'semantictype', 'rel_hassemtype', 'semantictype.idSemanticType,semantictype.entries.name as name,semantictype.idEntity, d.domainName')->orderBy('semantictype.entries.name'); $criteria->joinCriteria($domainCriteria, "(d.idDomain = semantictype.idDomain)"); $criteria->where('entity.idEntity', '=', $idEntity); Base::entryLanguage($criteria, 'semantictype'); return $criteria; }