本文整理匯總了PHP中PhabricatorOwnersPackage::loadOwningPackages方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorOwnersPackage::loadOwningPackages方法的具體用法?PHP PhabricatorOwnersPackage::loadOwningPackages怎麽用?PHP PhabricatorOwnersPackage::loadOwningPackages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhabricatorOwnersPackage
的用法示例。
在下文中一共展示了PhabricatorOwnersPackage::loadOwningPackages方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: queryByPath
private static function queryByPath($repo_callsign, $path)
{
$repository = id(new PhabricatorRepository())->loadOneWhere('callsign = %s', $repo_callsign);
if (empty($repository)) {
throw id(new ConduitException('ERR_REP_NOT_FOUND'))->setErrorDescription('Repository callsign ' . $repo_callsign . ' not recognized');
}
return PhabricatorOwnersPackage::loadOwningPackages($repository, $path);
}
示例2: queryByPath
private static function queryByPath(PhabricatorUser $viewer, $repo_callsign, $path)
{
$repository = id(new PhabricatorRepositoryQuery())->setViewer($viewer)->withCallsigns(array($repo_callsign))->executeOne();
if (!$repository) {
throw id(new ConduitException('ERR_REP_NOT_FOUND'))->setErrorDescription(pht('Repository callsign %s not recognized', $repo_callsign));
}
if ($path == null) {
return PhabricatorOwnersPackage::loadPackagesForRepository($repository);
} else {
return PhabricatorOwnersPackage::loadOwningPackages($repository, $path);
}
}
示例3: execute
protected function execute(ConduitAPIRequest $request)
{
$repository = id(new PhabricatorRepository())->loadOneWhere('callsign = %s', $request->getValue('repositoryCallsign'));
if (empty($repository)) {
throw new ConduitException('ERR_REP_NOT_FOUND');
}
$packages = PhabricatorOwnersPackage::loadOwningPackages($repository, $request->getValue('path'));
if (empty($packages)) {
throw new ConduitException('ERR_PATH_NOT_FOUND');
}
$result = array();
foreach ($packages as $package) {
$p_owners = id(new PhabricatorOwnersOwner())->loadAllForPackages(array($package));
$result[] = array('phid' => $package->getPHID(), 'name' => $package->getName(), 'primaryOwner' => $package->getPrimaryOwnerPHID(), 'owners' => array_values(mpull($p_owners, 'getUserPHID')));
}
return $result;
}