コード例 #1
0
 public function listChildren($idSuperType, $filter)
 {
     $criteria = $this->getCriteria()->select('idSemanticType, entry, idEntity, idDomain, entries.name as name')->orderBy('entries.name');
     Base::entryLanguage($criteria);
     if ($filter->idSemanticType) {
         $criteria->where("idSemanticType = {$filter->idSemanticType}");
     }
     if ($filter->idDomain) {
         $criteria->where("idDomain = {$filter->idDomain}");
     }
     if ($filter->type) {
         $criteria->where("upper(entries.name) LIKE upper('{$filter->type}%')");
     }
     $superType = new SemanticType($idSuperType);
     $entityRelation = new EntityRelation();
     $criteriaER = $entityRelation->getCriteria()->select('idEntity1')->where("relationtype.entry = 'rel_subtypeof'")->where("idEntity2 = {$superType->getIdEntity()}");
     $criteria->where("idEntity", "IN", $criteriaER);
     return $criteria;
 }