mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Update commands
This commit is contained in:
@@ -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;
|
||||||
|
@@ -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')));
|
||||||
}
|
}
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user