~ubuntu-branches/ubuntu/wily/phabricator/wily

« back to all changes in this revision

Viewing changes to phabricator/src/applications/metamta/query/PhabricatorMetaMTAApplicationEmailQuery.php

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2015-06-13 10:52:10 UTC
  • mfrom: (0.30.1) (0.29.1) (0.17.4) (2.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20150613105210-5uirr7tvnk0n6e6y
Tags: 0~git20150613-1
* New snapshot release (closes: #787805)
* fixed typo in logrotate script (closes: #787645)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
  }
36
36
 
37
37
  protected function loadPage() {
38
 
    $table  = new PhabricatorMetaMTAApplicationEmail();
39
 
    $conn_r = $table->establishConnection('r');
40
 
 
41
 
    $data = queryfx_all(
42
 
      $conn_r,
43
 
      'SELECT * FROM %T appemail %Q %Q %Q %Q',
44
 
      $table->getTableName(),
45
 
      $this->buildWhereClause($conn_r),
46
 
      $this->buildApplicationSearchGroupClause($conn_r),
47
 
      $this->buildOrderClause($conn_r),
48
 
      $this->buildLimitClause($conn_r));
49
 
 
50
 
    return $table->loadAllFromArray($data);
 
38
    return $this->loadStandardPage(new PhabricatorMetaMTAApplicationEmail());
51
39
  }
52
40
 
53
41
  protected function willFilterPage(array $app_emails) {
71
59
    return $app_emails;
72
60
  }
73
61
 
74
 
  protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
75
 
    $where = array();
 
62
  protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
 
63
    $where = parent::buildWhereClauseParts($conn);
76
64
 
77
65
    if ($this->addresses !== null) {
78
66
      $where[] = qsprintf(
79
 
        $conn_r,
 
67
        $conn,
80
68
        'appemail.address IN (%Ls)',
81
69
        $this->addresses);
82
70
    }
83
71
 
84
72
    if ($this->addressPrefix !== null) {
85
73
      $where[] = qsprintf(
86
 
        $conn_r,
 
74
        $conn,
87
75
        'appemail.address LIKE %>',
88
76
        $this->addressPrefix);
89
77
    }
90
78
 
91
79
    if ($this->applicationPHIDs !== null) {
92
80
      $where[] = qsprintf(
93
 
        $conn_r,
 
81
        $conn,
94
82
        'appemail.applicationPHID IN (%Ls)',
95
83
        $this->applicationPHIDs);
96
84
    }
97
85
 
98
86
    if ($this->phids !== null) {
99
87
      $where[] = qsprintf(
100
 
        $conn_r,
 
88
        $conn,
101
89
        'appemail.phid IN (%Ls)',
102
90
        $this->phids);
103
91
    }
104
92
 
105
93
    if ($this->ids !== null) {
106
94
      $where[] = qsprintf(
107
 
        $conn_r,
 
95
        $conn,
108
96
        'appemail.id IN (%Ld)',
109
97
        $this->ids);
110
98
    }
111
99
 
112
 
    $where[] = $this->buildPagingClause($conn_r);
113
 
 
114
 
    return $this->formatWhereClause($where);
 
100
    return $where;
115
101
  }
116
102
 
117
103
  protected function getPrimaryTableAlias() {