Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/DiffusionSymbolQuery.php
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | /* -( Configuring the Query )---------------------------------------------- */ | ||||
* @task config | * @task config | ||||
*/ | */ | ||||
public function needRepositories($need_repositories) { | public function needRepositories($need_repositories) { | ||||
$this->needRepositories = $need_repositories; | $this->needRepositories = $need_repositories; | ||||
return $this; | return $this; | ||||
} | } | ||||
/* -( Specialized Query )-------------------------------------------------- */ | |||||
public function existsSymbolsInRepository($repository_phid) { | |||||
$this | |||||
->withRepositoryPHIDs(array($repository_phid)) | |||||
->setLimit(1); | |||||
$symbol = new PhabricatorRepositorySymbol(); | |||||
$conn_r = $symbol->establishConnection('r'); | |||||
$data = queryfx_all( | |||||
$conn_r, | |||||
'SELECT * FROM %T %Q %Q', | |||||
$symbol->getTableName(), | |||||
$this->buildWhereClause($conn_r), | |||||
$this->buildLimitClause($conn_r)); | |||||
return (!empty($data)); | |||||
avivey: Mind if I keep this `empty()`, to effectively cast this to boolean? | |||||
} | |||||
/* -( Executing the Query )------------------------------------------------ */ | /* -( Executing the Query )------------------------------------------------ */ | ||||
/** | /** | ||||
* @task exec | * @task exec | ||||
*/ | */ | ||||
public function execute() { | public function execute() { | ||||
if ($this->name && $this->namePrefix) { | if ($this->name && $this->namePrefix) { | ||||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |
Mind if I keep this empty(), to effectively cast this to boolean?