# SynchronizeBasesDirectoryCommand

Extends \Symfony\Component\Console\Command\Command

Synchronizes known bases with a state of a directory

Tree format / synced_directory / synced_directory / one_base_subdirectory / synced_directory / one_base_subdirectory / base.nps|n32 will be synced / synced_directory / one_base_subdirectory / a.jpg will be synced to belong to base.nps|n32

author | Lukas Korinek
package | Default

### Methods

## __construct

    __construct(\NPS\Repository\FileRepository $fileRepo, \NPS\Repository\KnowledgeBaseRepository $baseRepo, \Doctrine\ORM\EntityManagerInterface $em)

### Arguments

#### $fileRepo

`\NPS\Repository\FileRepository`

#### $baseRepo

`\NPS\Repository\KnowledgeBaseRepository`

#### $em

`\Doctrine\ORM\EntityManagerInterface`

## configure

    configure()

inheritDoc |

## execute

    execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output)

inheritDoc |

### Arguments

#### $input

`\Symfony\Component\Console\Input\InputInterface`

#### $output

`\Symfony\Component\Console\Output\OutputInterface`

## Synchronizes a particular subdirectory with a knowledge base

    synchronizeDirectory(\Symfony\Component\Console\Output\OutputInterface $output, string $dir, string $status)

### Arguments

#### $output

`\Symfony\Component\Console\Output\OutputInterface`

#### $dir

`string`

Directory to sync

#### $status

`string`

Status to sync the directory to

## Synchronizes a media file

    synchronizeFile(\Symfony\Component\Console\Output\OutputInterface $output, string $path, string $discriminatorTag)

### Arguments

#### $output

`\Symfony\Component\Console\Output\OutputInterface`

#### $path

`string`

Path to the file

#### $discriminatorTag

`string`

Knowledge base discriminator tag

## Synchronizes a knowledge base file

    synchronizeKnowledgeBase(\Symfony\Component\Console\Output\OutputInterface $output, string $path, string $status) : \NPS\Model\KnowledgeBase|null

### Arguments

#### $output

`\Symfony\Component\Console\Output\OutputInterface`

#### $path

`string`

#### $status

`string`

### Response

`\NPS\Model\KnowledgeBase|null`

### Properties

## fileRepo

    fileRepo : \NPS\Repository\FileRepository

var |

### Type(s)

`\NPS\Repository\FileRepository`

## baseRepo

    baseRepo : \NPS\Repository\KnowledgeBaseRepository

var |

### Type(s)

`\NPS\Repository\KnowledgeBaseRepository`

## em

    em : \Doctrine\ORM\EntityManagerInterface

var |

### Type(s)

`\Doctrine\ORM\EntityManagerInterface`