Example #1
0
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->blueprintPHIDs !== null) {
         $where[] = qsprintf($conn, 'blueprintPHID IN (%Ls)', $this->blueprintPHIDs);
     }
     if ($this->resourcePHIDs !== null) {
         $where[] = qsprintf($conn, 'resourcePHID IN (%Ls)', $this->resourcePHIDs);
     }
     if ($this->leasePHIDs !== null) {
         $where[] = qsprintf($conn, 'leasePHID IN (%Ls)', $this->leasePHIDs);
     }
     return $where;
 }
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->ids !== null) {
         $where[] = qsprintf($conn, 'id IN (%Ld)', $this->ids);
     }
     if ($this->targetPHIDs !== null) {
         $where[] = qsprintf($conn, 'targetPHID IN (%Ls)', $this->targetPHIDs);
     }
     if ($this->consumed !== null) {
         $where[] = qsprintf($conn, 'isConsumed = %d', (int) $this->consumed);
     }
     return $where;
 }
 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn)
 {
     $where = parent::buildWhereClauseParts($conn);
     if ($this->resourceIDs !== null) {
         $where[] = qsprintf($conn, 'resourceID IN (%Ld)', $this->resourceIDs);
     }
     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->statuses !== null) {
         $where[] = qsprintf($conn, 'status IN (%Ld)', $this->statuses);
     }
     return $where;
 }
 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->datasourceQuery !== null) {
         $where[] = qsprintf($conn, 'blueprintName LIKE %>', $this->datasourceQuery);
     }
     if ($this->blueprintClasses !== null) {
         $where[] = qsprintf($conn, 'className IN (%Ls)', $this->blueprintClasses);
     }
     return $where;
 }
 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->blueprintPHIDs !== null) {
         $where[] = qsprintf($conn, 'blueprintPHID IN (%Ls)', $this->blueprintPHIDs);
     }
     if ($this->objectPHIDs !== null) {
         $where[] = qsprintf($conn, 'objectPHID IN (%Ls)', $this->objectPHIDs);
     }
     if ($this->blueprintStates !== null) {
         $where[] = qsprintf($conn, 'blueprintAuthorizationState IN (%Ls)', $this->blueprintStates);
     }
     if ($this->objectStates !== null) {
         $where[] = qsprintf($conn, 'objectAuthorizationState IN (%Ls)', $this->objectStates);
     }
     return $where;
 }
 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->objectPHIDs !== null) {
         $where[] = qsprintf($conn, 'objectPHID IN (%Ls)', $this->objectPHIDs);
     }
     if ($this->repositoryPHIDs !== null) {
         $where[] = qsprintf($conn, 'repositoryPHID IN (%Ls)', $this->repositoryPHIDs);
     }
     if ($this->operationStates !== null) {
         $where[] = qsprintf($conn, 'operationState IN (%Ls)', $this->operationStates);
     }
     if ($this->operationTypes !== null) {
         $where[] = qsprintf($conn, 'operationType IN (%Ls)', $this->operationTypes);
     }
     if ($this->isDismissed !== null) {
         $where[] = qsprintf($conn, 'isDismissed = %d', (int) $this->isDismissed);
     }
     return $where;
 }
 protected function buildJoinClauseParts(AphrontDatabaseConnection $conn)
 {
     $joins = parent::buildJoinClauseParts($conn);
     if ($this->authorizedPHIDs !== null) {
         $joins[] = qsprintf($conn, 'JOIN %T authorization
       ON authorization.blueprintPHID = blueprint.phid
       AND authorization.objectPHID IN (%Ls)
       AND authorization.objectAuthorizationState = %s
       AND authorization.blueprintAuthorizationState = %s', id(new DrydockAuthorization())->getTableName(), $this->authorizedPHIDs, DrydockAuthorization::OBJECTAUTH_ACTIVE, DrydockAuthorization::BLUEPRINTAUTH_AUTHORIZED);
     }
     return $joins;
 }