Changeset View
Changeset View
Standalone View
Standalone View
src/applications/meta/query/PhabricatorApplicationQuery.php
| <?php | <?php | ||||
| final class PhabricatorApplicationQuery | final class PhabricatorApplicationQuery | ||||
| extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
| private $installed; | private $installed; | ||||
| private $beta; | private $prototypes; | ||||
| private $firstParty; | private $firstParty; | ||||
| private $nameContains; | private $nameContains; | ||||
| private $unlisted; | private $unlisted; | ||||
| private $classes; | private $classes; | ||||
| private $launchable; | private $launchable; | ||||
| private $phids; | private $phids; | ||||
| const ORDER_APPLICATION = 'order:application'; | const ORDER_APPLICATION = 'order:application'; | ||||
| const ORDER_NAME = 'order:name'; | const ORDER_NAME = 'order:name'; | ||||
| private $order = self::ORDER_APPLICATION; | private $order = self::ORDER_APPLICATION; | ||||
| public function withNameContains($name_contains) { | public function withNameContains($name_contains) { | ||||
| $this->nameContains = $name_contains; | $this->nameContains = $name_contains; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withInstalled($installed) { | public function withInstalled($installed) { | ||||
| $this->installed = $installed; | $this->installed = $installed; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withBeta($beta) { | public function withPrototypes($prototypes) { | ||||
| $this->beta = $beta; | $this->prototypes = $prototypes; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withFirstParty($first_party) { | public function withFirstParty($first_party) { | ||||
| $this->firstParty = $first_party; | $this->firstParty = $first_party; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | public function loadPage() { | ||||
| if ($this->installed !== null) { | if ($this->installed !== null) { | ||||
| foreach ($apps as $key => $app) { | foreach ($apps as $key => $app) { | ||||
| if ($app->isInstalled() != $this->installed) { | if ($app->isInstalled() != $this->installed) { | ||||
| unset($apps[$key]); | unset($apps[$key]); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if ($this->beta !== null) { | if ($this->prototypes !== null) { | ||||
| foreach ($apps as $key => $app) { | foreach ($apps as $key => $app) { | ||||
| if ($app->isBeta() != $this->beta) { | if ($app->isPrototype() != $this->prototypes) { | ||||
| unset($apps[$key]); | unset($apps[$key]); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if ($this->firstParty !== null) { | if ($this->firstParty !== null) { | ||||
| foreach ($apps as $key => $app) { | foreach ($apps as $key => $app) { | ||||
| if ($app->isFirstParty() != $this->firstParty) { | if ($app->isFirstParty() != $this->firstParty) { | ||||
| ▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines | |||||