Skip to content

Commit

Permalink
fix(command): add attributes support
Browse files Browse the repository at this point in the history
  • Loading branch information
jnadaud committed Jan 24, 2023
1 parent 6868622 commit 4ade0f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/Command/CreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
namespace ACSEO\TypesenseBundle\Command;

use ACSEO\TypesenseBundle\Manager\CollectionManager;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand(
name: 'typesense:create',
)]
class CreateCommand extends Command
{
protected static $defaultName = 'typesense:create';
private $collectionManager;

public function __construct(CollectionManager $collectionManager)
Expand All @@ -23,7 +26,6 @@ public function __construct(CollectionManager $collectionManager)
protected function configure()
{
$this
->setName(self::$defaultName)
->setDescription('Create Typsenses indexes')

;
Expand Down
7 changes: 4 additions & 3 deletions src/Command/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
use ACSEO\TypesenseBundle\Manager\DocumentManager;
use ACSEO\TypesenseBundle\Transformer\DoctrineToTypesenseTransformer;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

#[AsCommand(
name: 'typesense:import',
)]
class ImportCommand extends Command
{
protected static $defaultName = 'typesense:import';

private $em;
private $collectionManager;
private $documentManager;
Expand Down Expand Up @@ -45,7 +47,6 @@ public function __construct(
protected function configure()
{
$this
->setName(self::$defaultName)
->setDescription('Import collections from Database')
->addOption('action', null, InputOption::VALUE_OPTIONAL, 'Action modes for typesense import ("create", "upsert" or "update")', 'upsert')
;
Expand Down

0 comments on commit 4ade0f0

Please sign in to comment.