Page MenuHomec4science

20140904.macroattach.php
No OneTemporary

File Metadata

Created
Sat, Nov 30, 08:43

20140904.macroattach.php

<?php
$table = new PhabricatorFileImageMacro();
foreach (new LiskMigrationIterator($table) as $macro) {
$name = $macro->getName();
echo pht("Linking macro '%s'...", $name)."\n";
$editor = new PhabricatorEdgeEditor();
$phids[] = $macro->getFilePHID();
$phids[] = $macro->getAudioPHID();
$phids = array_filter($phids);
if ($phids) {
foreach ($phids as $phid) {
$editor->addEdge(
$macro->getPHID(),
PhabricatorObjectHasFileEdgeType::EDGECONST,
$phid);
}
$editor->save();
}
}
echo pht('Done.')."\n";

Event Timeline