Esempio n. 1
0
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'phid IN (%Ls)', $this->phids);
     }
     return $where;
 }
Esempio n. 2
0
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->types !== null) {
         $where[] = qsprintf($conn, 'source.type IN (%Ls)', $this->types);
     }
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'source.id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'source.phid IN (%Ls)', $this->phids);
     }
     if ($this->isDisabled !== null) {
         $where[] = qsprintf($conn, 'source.isDisabled = %d', (int) $this->isDisabled);
     }
     if ($this->hasCursors !== null) {
         $cursor_types = array();
         $definitions = NuanceSourceDefinition::getAllDefinitions();
         foreach ($definitions as $key => $definition) {
             if ($definition->hasImportCursors()) {
                 $cursor_types[] = $key;
             }
         }
         if ($this->hasCursors) {
             if (!$cursor_types) {
                 throw new PhabricatorEmptyQueryException();
             } else {
                 $where[] = qsprintf($conn, 'source.type IN (%Ls)', $cursor_types);
             }
         } else {
             if (!$cursor_types) {
                 // Apply no constraint.
             } else {
                 $where[] = qsprintf($conn, 'source.type NOT IN (%Ls)', $cursor_types);
             }
         }
     }
     return $where;
 }
Esempio n. 3
0
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->sourcePHIDs !== null) {
         $where[] = qsprintf($conn, 'sourcePHID IN (%Ls)', $this->sourcePHIDs);
     }
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'phid IN (%Ls)', $this->phids);
     }
     if ($this->itemTypes !== null) {
         $where[] = qsprintf($conn, 'itemType IN (%Ls)', $this->itemTypes);
     }
     if ($this->itemKeys !== null) {
         $where[] = qsprintf($conn, 'itemKey IN (%Ls)', $this->itemKeys);
     }
     if ($this->containerKeys !== null) {
         $where[] = qsprintf($conn, 'itemContainerKey IN (%Ls)', $this->containerKeys);
     }
     return $where;
 }