3 final class PhabricatorCalendarImportQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery
{
11 public function withIDs(array $ids) {
16 public function withPHIDs(array $phids) {
17 $this->phids
= $phids;
21 public function withAuthorPHIDs(array $phids) {
22 $this->authorPHIDs
= $phids;
26 public function withIsDisabled($is_disabled) {
27 $this->isDisabled
= $is_disabled;
31 public function newResultObject() {
32 return new PhabricatorCalendarImport();
35 protected function buildWhereClauseParts(AphrontDatabaseConnection
$conn) {
36 $where = parent
::buildWhereClauseParts($conn);
38 if ($this->ids
!== null) {
45 if ($this->phids
!== null) {
48 'import.phid IN (%Ls)',
52 if ($this->authorPHIDs
!== null) {
55 'import.authorPHID IN (%Ls)',
59 if ($this->isDisabled
!== null) {
62 'import.isDisabled = %d',
63 (int)$this->isDisabled
);
69 protected function willFilterPage(array $page) {
70 $engines = PhabricatorCalendarImportEngine
::getAllImportEngines();
71 foreach ($page as $key => $import) {
72 $engine_type = $import->getEngineType();
73 $engine = idx($engines, $engine_type);
77 $this->didRejectResult($import);
81 $import->attachEngine(clone $engine);
87 protected function getPrimaryTableAlias() {
91 public function getQueryApplicationClass() {
92 return 'PhabricatorCalendarApplication';