本文整理汇总了PHP中GitRepository::getDeletionDate方法的典型用法代码示例。如果您正苦于以下问题:PHP GitRepository::getDeletionDate方法的具体用法?PHP GitRepository::getDeletionDate怎么用?PHP GitRepository::getDeletionDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitRepository
的用法示例。
在下文中一共展示了GitRepository::getDeletionDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete(GitRepository $repository)
{
$id = $repository->getId();
$projectId = $repository->getProjectId();
$id = $this->da->escapeInt($id);
$projectId = $this->da->escapeInt($projectId);
if (empty($id) || empty($projectId)) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_delete_params'));
}
$deletionDate = $repository->getDeletionDate();
$projectName = $repository->getProject()->getUnixName();
$backup_path = str_replace('/', '_', $repository->getFullName());
$backup_path .= '_' . strtotime($deletionDate);
$backup_path = $projectName . '_' . $backup_path;
$backup_path = $this->da->quoteSmart($backup_path);
$deletionDate = $this->da->quoteSmart($deletionDate);
$query = ' UPDATE ' . $this->getTable() . ' SET ' . self::REPOSITORY_DELETION_DATE . '=' . $deletionDate . ', ' . self::REPOSITORY_BACKUP_PATH . '=' . $backup_path . ' WHERE ' . self::REPOSITORY_ID . '=' . $id . ' AND ' . self::FK_PROJECT_ID . '=' . $projectId;
$r = $this->update($query);
$ar = $this->da->affectedRows();
if ($r === false || $ar == 0) {
throw new GitDaoException($GLOBALS['Language']->getText('plugin_git', 'dao_delete_error') . ' ' . $this->da->isError());
}
if ($ar == 1) {
return true;
}
return false;
}