Update commands

This commit is contained in:
Romain Neutron
2012-09-21 15:50:51 +02:00
parent ff1613b8d8
commit ab8d2fd6b4
3 changed files with 4 additions and 4 deletions

View File

@@ -55,11 +55,11 @@ class CreateCollection extends Command
$databox = $this->container['phraseanet.appbox'] $databox = $this->container['phraseanet.appbox']
->get_databox((int) $input->getArgument('databox_id')); ->get_databox((int) $input->getArgument('databox_id'));
$new_collection = \collection::create($databox, $this->container['phraseanet.appbox'], $input->getArgument('collname')); $new_collection = \collection::create($app, $databox, $this->container['phraseanet.appbox'], $input->getArgument('collname'));
if ($new_collection && $input->getOption('duplicate_rights_from_base_id')) { if ($new_collection && $input->getOption('duplicate_rights_from_base_id')) {
$query = new \User_Query($this->container['phraseanet.appbox']); $query = new \User_Query($this->container);
$total = $query->on_base_ids(array($input->getOption('duplicate_rights_from_base_id')))->get_total(); $total = $query->on_base_ids(array($input->getOption('duplicate_rights_from_base_id')))->get_total();
$n = 0; $n = 0;

View File

@@ -58,7 +58,7 @@ class RecordAdd extends Command
protected function doExecute(InputInterface $input, OutputInterface $output) protected function doExecute(InputInterface $input, OutputInterface $output)
{ {
try { try {
$collection = \collection::get_from_base_id($input->getArgument('base_id')); $collection = \collection::get_from_base_id($app, $input->getArgument('base_id'));
} catch (\Exception $e) { } catch (\Exception $e) {
throw new \InvalidArgumentException(sprintf('Collection %s is invalid', $input->getArgument('base_id'))); throw new \InvalidArgumentException(sprintf('Collection %s is invalid', $input->getArgument('base_id')));
} }

View File

@@ -124,7 +124,7 @@ class Step31 implements DatasUpgraderInterface
$uuid = \uuid::generate_v4(); $uuid = \uuid::generate_v4();
try { try {
$media = $this->app['mediavorus']->guess($pathfile); $media = $this->app['mediavorus']->guess($pathfile);
$collection = \collection::get_from_coll_id($databox, (int) $record['coll_id']); $collection = \collection::get_from_coll_id($app, $databox, (int) $record['coll_id']);
$file = new File($media, $collection); $file = new File($media, $collection);
$uuid = $file->getUUID(true, true); $uuid = $file->getUUID(true, true);