本文整理汇总了PHP中GitRepository::getPathWithoutLazyLoading方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::getPathWithoutLazyLoading方法的具体用法?PHP GitRepository::getPathWithoutLazyLoading怎么用?PHP GitRepository::getPathWithoutLazyLoading使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitRepository
的用法示例。
在下文中一共展示了GitRepository::getPathWithoutLazyLoading方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProjectRepository
/**
* This function initialize a GitRepository object with its database value
* @param GitRepository $repository
* @return <type>
*/
public function getProjectRepository($repository)
{
$projectId = $repository->getProjectId();
$repositoryPath = $repository->getPathWithoutLazyLoading();
if (empty($projectId) || empty($repositoryPath)) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_search_params'));
}
$rs = $this->searchProjectRepositoryByPath($projectId, $repositoryPath);
if (empty($rs)) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_search_error'));
return false;
}
$result = $rs->getRow();
if (empty($result)) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_search_error'));
return false;
}
$this->hydrateRepositoryObject($repository, $result);
return true;
}
示例2: isRepositoryNameAlreadyUsed
/**
* Return true if proposed name already exists as a repository path
*
* @param Project $project
* @param String $name
*
* @return Boolean
*/
public function isRepositoryNameAlreadyUsed(GitRepository $new_repository)
{
$repositories = $this->repository_factory->getAllRepositories($new_repository->getProject());
foreach ($repositories as $existing_repo) {
$new_repo_path = $new_repository->getPathWithoutLazyLoading();
$existing_repo_path = $existing_repo->getPathWithoutLazyLoading();
if ($new_repo_path == $existing_repo_path) {
return true;
}
if ($this->nameIsSubPathOfExistingRepository($existing_repo_path, $new_repo_path)) {
return true;
}
if ($this->nameAlreadyExistsAsPath($existing_repo_path, $new_repo_path)) {
return true;
}
}
}