本文整理汇总了PHP中PhabricatorProject::isMilestone方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorProject::isMilestone方法的具体用法?PHP PhabricatorProject::isMilestone怎么用?PHP PhabricatorProject::isMilestone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorProject
的用法示例。
在下文中一共展示了PhabricatorProject::isMilestone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: materializeProject
private function materializeProject(PhabricatorProject $project)
{
if ($project->isMilestone()) {
return;
}
$material_type = PhabricatorProjectMaterializedMemberEdgeType::EDGECONST;
$member_type = PhabricatorProjectProjectHasMemberEdgeType::EDGECONST;
$project_phid = $project->getPHID();
$descendants = id(new PhabricatorProjectQuery())->setViewer($this->getViewer())->withAncestorProjectPHIDs(array($project->getPHID()))->withIsMilestone(false)->withHasSubprojects(false)->execute();
$descendant_phids = mpull($descendants, 'getPHID');
if ($descendant_phids) {
$source_phids = $descendant_phids;
$has_subprojects = true;
} else {
$source_phids = array($project->getPHID());
$has_subprojects = false;
}
$conn_w = $project->establishConnection('w');
$project->openTransaction();
// Delete any existing materialized member edges.
queryfx($conn_w, 'DELETE FROM %T WHERE src = %s AND type = %s', PhabricatorEdgeConfig::TABLE_NAME_EDGE, $project_phid, $material_type);
// Copy current member edges to create new materialized edges.
queryfx($conn_w, 'INSERT IGNORE INTO %T (src, type, dst, dateCreated, seq)
SELECT %s, %d, dst, dateCreated, seq FROM %T
WHERE src IN (%Ls) AND type = %d', PhabricatorEdgeConfig::TABLE_NAME_EDGE, $project_phid, $material_type, PhabricatorEdgeConfig::TABLE_NAME_EDGE, $source_phids, $member_type);
// Update the hasSubprojects flag.
queryfx($conn_w, 'UPDATE %T SET hasSubprojects = %d WHERE id = %d', $project->getTableName(), (int) $has_subprojects, $project->getID());
$project->saveTransaction();
}
开发者ID:phpengineer,项目名称:phabricator,代码行数:29,代码来源:PhabricatorProjectsMembershipIndexEngineExtension.php
示例2: setDefaultProfilePicture
private function setDefaultProfilePicture(PhabricatorProject $project)
{
if ($project->isMilestone()) {
return;
}
$compose_color = $project->getDisplayIconComposeColor();
$compose_icon = $project->getDisplayIconComposeIcon();
$builtin = id(new PhabricatorFilesComposeIconBuiltinFile())->setColor($compose_color)->setIcon($compose_icon);
$data = $builtin->loadBuiltinFileData();
$file = PhabricatorFile::newFromFileData($data, array('name' => $builtin->getBuiltinDisplayName(), 'profile' => true, 'canCDN' => true));
$project->setProfileImagePHID($file->getPHID())->save();
}