コード例 #1
0
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'service.id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'service.phid IN (%Ls)', $this->phids);
     }
     if ($this->names !== null) {
         $hashes = array();
         foreach ($this->names as $name) {
             $hashes[] = PhabricatorHash::digestForIndex($name);
         }
         $where[] = qsprintf($conn, 'service.nameIndex IN (%Ls)', $hashes);
     }
     if ($this->serviceTypes !== null) {
         $where[] = qsprintf($conn, 'service.serviceType IN (%Ls)', $this->serviceTypes);
     }
     if ($this->devicePHIDs !== null) {
         $where[] = qsprintf($conn, 'binding.devicePHID IN (%Ls)', $this->devicePHIDs);
     }
     if ($this->namePrefix !== null) {
         $where[] = qsprintf($conn, 'service.name LIKE %>', $this->namePrefix);
     }
     if ($this->nameSuffix !== null) {
         $where[] = qsprintf($conn, 'service.name LIKE %<', $this->nameSuffix);
     }
     return $where;
 }
コード例 #2
0
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'network.id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'network.phid IN (%Ls)', $this->phids);
     }
     return $where;
 }
コード例 #3
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);
     }
     if ($this->servicePHIDs !== null) {
         $where[] = qsprintf($conn, 'servicePHID IN (%Ls)', $this->servicePHIDs);
     }
     if ($this->devicePHIDs !== null) {
         $where[] = qsprintf($conn, 'devicePHID IN (%Ls)', $this->devicePHIDs);
     }
     if ($this->interfacePHIDs !== null) {
         $where[] = qsprintf($conn, 'interfacePHID IN (%Ls)', $this->interfacePHIDs);
     }
     return $where;
 }
コード例 #4
0
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'interface.id IN (%Ld)', $this->ids);
     }
     if ($this->phids !== null) {
         $where[] = qsprintf($conn, 'interface.phid IN (%Ls)', $this->phids);
     }
     if ($this->networkPHIDs !== null) {
         $where[] = qsprintf($conn, 'interface.networkPHID IN (%Ls)', $this->networkPHIDs);
     }
     if ($this->devicePHIDs !== null) {
         $where[] = qsprintf($conn, 'interface.devicePHID IN (%Ls)', $this->devicePHIDs);
     }
     if ($this->addresses !== null) {
         $parts = array();
         foreach ($this->addresses as $address) {
             $parts[] = qsprintf($conn, '(interface.networkPHID = %s ' . 'AND interface.address = %s ' . 'AND interface.port = %d)', $address->getNetworkPHID(), $address->getAddress(), $address->getPort());
         }
         $where[] = implode(' OR ', $parts);
     }
     return $where;
 }