Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(command): add attributes support #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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