Rename FOQ namespaces and services to FOS
This commit is contained in:
parent
22ad3cfe01
commit
49de4d361d
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
use Elastica_Client;
|
||||
use FOQ\ElasticaBundle\Logger\ElasticaLogger;
|
||||
use FOS\ElasticaBundle\Logger\ElasticaLogger;
|
||||
|
||||
/**
|
||||
* @author Gordon Franke <info@nevalon.de>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Command;
|
||||
namespace FOS\ElasticaBundle\Command;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
@ -20,7 +20,7 @@ class PopulateCommand extends ContainerAwareCommand
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('foq:elastica:populate')
|
||||
->setName('fos:elastica:populate')
|
||||
->setDescription('Populates search indexes from providers')
|
||||
->addOption('no-reset', null, InputOption::VALUE_NONE, 'Do not reset the indexes before they are populated.');
|
||||
}
|
||||
|
@ -32,18 +32,18 @@ class PopulateCommand extends ContainerAwareCommand
|
|||
{
|
||||
if (!$input->getOption('no-reset')) {
|
||||
$output->writeln('Resetting indexes');
|
||||
$this->getContainer()->get('foq_elastica.reseter')->reset();
|
||||
$this->getContainer()->get('fos_elastica.reseter')->reset();
|
||||
}
|
||||
|
||||
$output->writeln('Populating indexes');
|
||||
$this->getContainer()->get('foq_elastica.populator')->populate(function($text) use ($output) {
|
||||
$this->getContainer()->get('fos_elastica.populator')->populate(function($text) use ($output) {
|
||||
$output->writeLn($text);
|
||||
});
|
||||
|
||||
$output->writeln('Refreshing indexes');
|
||||
array_map(function($index) {
|
||||
$index->refresh();
|
||||
}, $this->getContainer()->get('foq_elastica.index_manager')->getAllIndexes());
|
||||
}, $this->getContainer()->get('fos_elastica.index_manager')->getAllIndexes());
|
||||
|
||||
$output->writeln('Done');
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Command;
|
||||
namespace FOS\ElasticaBundle\Command;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
@ -32,7 +32,7 @@ class SearchCommand extends ContainerAwareCommand
|
|||
->addOption('show-source', null, InputOption::VALUE_NONE, 'Show the documents sources')
|
||||
->addOption('show-id', null, InputOption::VALUE_NONE, 'Show the documents ids')
|
||||
->addOption('explain', null, InputOption::VALUE_NONE, 'Enables explanation for each hit on how its score was computed.')
|
||||
->setName('foq:elastica:search')
|
||||
->setName('fos:elastica:search')
|
||||
->setDescription('Searches documents in a given type and index');
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ class SearchCommand extends ContainerAwareCommand
|
|||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$index = $this->getContainer()->get('foq_elastica.index_manager')->getIndex($input->getOption('index'));
|
||||
$index = $this->getContainer()->get('fos_elastica.index_manager')->getIndex($input->getOption('index'));
|
||||
$type = $index->getType($input->getArgument('type'));
|
||||
$query = Elastica_Query::create($input->getArgument('query'));
|
||||
$query->setLimit($input->getOption('limit'));
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Configuration;
|
||||
namespace FOS\ElasticaBundle\Configuration;
|
||||
|
||||
/**
|
||||
* Annotation class for setting search repository.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\DataCollector;
|
||||
namespace FOS\ElasticaBundle\DataCollector;
|
||||
|
||||
use FOQ\ElasticaBundle\Logger\ElasticaLogger;
|
||||
use FOS\ElasticaBundle\Logger\ElasticaLogger;
|
||||
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\DependencyInjection\Compiler;
|
||||
namespace FOS\ElasticaBundle\DependencyInjection\Compiler;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
|
@ -13,15 +13,15 @@ class AddProviderPass implements CompilerPassInterface
|
|||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (!$container->hasDefinition('foq_elastica.populator')) {
|
||||
if (!$container->hasDefinition('fos_elastica.populator')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$providers = array();
|
||||
foreach ($container->findTaggedServiceIds('foq_elastica.provider') as $id => $attributes) {
|
||||
foreach ($container->findTaggedServiceIds('fos_elastica.provider') as $id => $attributes) {
|
||||
$providers[$id] = new Reference($id);
|
||||
}
|
||||
|
||||
$container->getDefinition('foq_elastica.populator')->replaceArgument(0, $providers);
|
||||
$container->getDefinition('fos_elastica.populator')->replaceArgument(0, $providers);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\DependencyInjection\Compiler;
|
||||
namespace FOS\ElasticaBundle\DependencyInjection\Compiler;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
|
@ -20,13 +20,13 @@ class TransformerPass implements CompilerPassInterface
|
|||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (!$container->hasDefinition('foq_elastica.elastica_to_model_transformer.collection.prototype')) {
|
||||
if (!$container->hasDefinition('fos_elastica.elastica_to_model_transformer.collection.prototype')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$transformers = array();
|
||||
|
||||
foreach ($container->findTaggedServiceIds('foq_elastica.elastica_to_model_transformer') as $id => $tags) {
|
||||
foreach ($container->findTaggedServiceIds('fos_elastica.elastica_to_model_transformer') as $id => $tags) {
|
||||
foreach ($tags as $tag) {
|
||||
if (empty($tag['index']) || empty($tag['type'])) {
|
||||
throw new InvalidArgumentException('The Transformer must have both a type and an index defined.');
|
||||
|
@ -37,11 +37,11 @@ class TransformerPass implements CompilerPassInterface
|
|||
}
|
||||
|
||||
foreach ($transformers as $index => $indexTransformers) {
|
||||
if (!$container->hasDefinition(sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $index))) {
|
||||
if (!$container->hasDefinition(sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $index))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$index = $container->getDefinition(sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $index));
|
||||
$index = $container->getDefinition(sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $index));
|
||||
$index->replaceArgument(0, $indexTransformers);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\DependencyInjection;
|
||||
namespace FOS\ElasticaBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
|
@ -17,7 +17,7 @@ class Configuration
|
|||
public function getConfigTree()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$rootNode = $treeBuilder->root('foq_elastica', 'array');
|
||||
$rootNode = $treeBuilder->root('fos_elastica', 'array');
|
||||
|
||||
$this->addClientsSection($rootNode);
|
||||
$this->addIndexesSection($rootNode);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\DependencyInjection;
|
||||
namespace FOS\ElasticaBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Processor;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
@ -12,7 +12,7 @@ use Symfony\Component\DependencyInjection\Reference;
|
|||
use Symfony\Component\Config\FileLocator;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class FOQElasticaExtension extends Extension
|
||||
class FOSElasticaExtension extends Extension
|
||||
{
|
||||
protected $indexConfigs = array();
|
||||
protected $typeFields = array();
|
||||
|
@ -50,8 +50,8 @@ class FOQElasticaExtension extends Extension
|
|||
$this->loadIndexManager($indexDefsByName, $container->getDefinition($indexIdsByName[$config['default_index']]), $container);
|
||||
$this->loadReseter($this->indexConfigs, $container);
|
||||
|
||||
$container->setAlias('foq_elastica.client', sprintf('foq_elastica.client.%s', $config['default_client']));
|
||||
$container->setAlias('foq_elastica.index', sprintf('foq_elastica.index.%s', $config['default_index']));
|
||||
$container->setAlias('fos_elastica.client', sprintf('fos_elastica.client.%s', $config['default_client']));
|
||||
$container->setAlias('fos_elastica.index', sprintf('fos_elastica.index.%s', $config['default_index']));
|
||||
|
||||
$this->createDefaultManagerAlias($config['default_manager'], $container);
|
||||
}
|
||||
|
@ -66,10 +66,10 @@ class FOQElasticaExtension extends Extension
|
|||
{
|
||||
$clientIds = array();
|
||||
foreach ($clients as $name => $clientConfig) {
|
||||
$clientDef = $container->getDefinition('foq_elastica.client');
|
||||
$clientDef = $container->getDefinition('fos_elastica.client');
|
||||
$clientDef->replaceArgument(0, $clientConfig);
|
||||
|
||||
$clientId = sprintf('foq_elastica.client.%s', $name);
|
||||
$clientId = sprintf('fos_elastica.client.%s', $name);
|
||||
|
||||
$container->setDefinition($clientId, $clientDef);
|
||||
|
||||
|
@ -99,9 +99,9 @@ class FOQElasticaExtension extends Extension
|
|||
}
|
||||
|
||||
$clientId = $clientIdsByName[$clientName];
|
||||
$indexId = sprintf('foq_elastica.index.%s', $name);
|
||||
$indexId = sprintf('fos_elastica.index.%s', $name);
|
||||
$indexDefArgs = array($name);
|
||||
$indexDef = new Definition('%foq_elastica.index.class%', $indexDefArgs);
|
||||
$indexDef = new Definition('%fos_elastica.index.class%', $indexDefArgs);
|
||||
$indexDef->setFactoryService($clientId);
|
||||
$indexDef->setFactoryMethod('getIndex');
|
||||
$container->setDefinition($indexId, $indexDef);
|
||||
|
@ -135,13 +135,13 @@ class FOQElasticaExtension extends Extension
|
|||
*/
|
||||
protected function loadIndexFinder(ContainerBuilder $container, $name, $indexId)
|
||||
{
|
||||
$abstractTransformerId = 'foq_elastica.elastica_to_model_transformer.collection.prototype';
|
||||
$transformerId = sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $name);
|
||||
$abstractTransformerId = 'fos_elastica.elastica_to_model_transformer.collection.prototype';
|
||||
$transformerId = sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $name);
|
||||
$transformerDef = new DefinitionDecorator($abstractTransformerId);
|
||||
$container->setDefinition($transformerId, $transformerDef);
|
||||
|
||||
$abstractFinderId = 'foq_elastica.finder.prototype';
|
||||
$finderId = sprintf('foq_elastica.finder.%s', $name);
|
||||
$abstractFinderId = 'fos_elastica.finder.prototype';
|
||||
$finderId = sprintf('fos_elastica.finder.%s', $name);
|
||||
$finderDef = new DefinitionDecorator($abstractFinderId);
|
||||
$finderDef->replaceArgument(0, new Reference($indexId));
|
||||
$finderDef->replaceArgument(1, new Reference($transformerId));
|
||||
|
@ -163,7 +163,7 @@ class FOQElasticaExtension extends Extension
|
|||
$type = self::deepArrayUnion($typePrototypeConfig, $type);
|
||||
$typeId = sprintf('%s.%s', $indexId, $name);
|
||||
$typeDefArgs = array($name);
|
||||
$typeDef = new Definition('%foq_elastica.type.class%', $typeDefArgs);
|
||||
$typeDef = new Definition('%fos_elastica.type.class%', $typeDefArgs);
|
||||
$typeDef->setFactoryService($indexId);
|
||||
$typeDef->setFactoryMethod('getType');
|
||||
$container->setDefinition($typeId, $typeDef);
|
||||
|
@ -217,7 +217,7 @@ class FOQElasticaExtension extends Extension
|
|||
|
||||
if (isset($typeConfig['provider'])) {
|
||||
$providerId = $this->loadTypeProvider($typeConfig, $container, $objectPersisterId, $typeDef, $indexName, $typeName);
|
||||
$container->getDefinition('foq_elastica.populator')->addMethodCall('addProvider', array($providerId, new Reference($providerId)));
|
||||
$container->getDefinition('fos_elastica.populator')->addMethodCall('addProvider', array($providerId, new Reference($providerId)));
|
||||
}
|
||||
if (isset($typeConfig['finder'])) {
|
||||
$this->loadTypeFinder($typeConfig, $container, $elasticaToModelTransformerId, $typeDef, $indexName, $typeName);
|
||||
|
@ -232,10 +232,10 @@ class FOQElasticaExtension extends Extension
|
|||
if (isset($typeConfig['elastica_to_model_transformer']['service'])) {
|
||||
return $typeConfig['elastica_to_model_transformer']['service'];
|
||||
}
|
||||
$abstractId = sprintf('foq_elastica.elastica_to_model_transformer.prototype.%s', $typeConfig['driver']);
|
||||
$serviceId = sprintf('foq_elastica.elastica_to_model_transformer.%s.%s', $indexName, $typeName);
|
||||
$abstractId = sprintf('fos_elastica.elastica_to_model_transformer.prototype.%s', $typeConfig['driver']);
|
||||
$serviceId = sprintf('fos_elastica.elastica_to_model_transformer.%s.%s', $indexName, $typeName);
|
||||
$serviceDef = new DefinitionDecorator($abstractId);
|
||||
$serviceDef->addTag('foq_elastica.elastica_to_model_transformer', array('type' => $typeName, 'index' => $indexName));
|
||||
$serviceDef->addTag('fos_elastica.elastica_to_model_transformer', array('type' => $typeName, 'index' => $indexName));
|
||||
|
||||
// Doctrine has a mandatory service as first argument
|
||||
$argPos = ('propel' === $typeConfig['driver']) ? 0 : 1;
|
||||
|
@ -255,8 +255,8 @@ class FOQElasticaExtension extends Extension
|
|||
if (isset($typeConfig['model_to_elastica_transformer']['service'])) {
|
||||
return $typeConfig['model_to_elastica_transformer']['service'];
|
||||
}
|
||||
$abstractId = sprintf('foq_elastica.model_to_elastica_transformer.prototype.auto');
|
||||
$serviceId = sprintf('foq_elastica.model_to_elastica_transformer.%s.%s', $indexName, $typeName);
|
||||
$abstractId = sprintf('fos_elastica.model_to_elastica_transformer.prototype.auto');
|
||||
$serviceId = sprintf('fos_elastica.model_to_elastica_transformer.%s.%s', $indexName, $typeName);
|
||||
$serviceDef = new DefinitionDecorator($abstractId);
|
||||
$serviceDef->replaceArgument(0, array(
|
||||
'identifier' => $typeConfig['identifier']
|
||||
|
@ -268,8 +268,8 @@ class FOQElasticaExtension extends Extension
|
|||
|
||||
protected function loadObjectPersister(array $typeConfig, Definition $typeDef, ContainerBuilder $container, $indexName, $typeName, $transformerId)
|
||||
{
|
||||
$abstractId = sprintf('foq_elastica.object_persister.prototype');
|
||||
$serviceId = sprintf('foq_elastica.object_persister.%s.%s', $indexName, $typeName);
|
||||
$abstractId = sprintf('fos_elastica.object_persister.prototype');
|
||||
$serviceId = sprintf('fos_elastica.object_persister.%s.%s', $indexName, $typeName);
|
||||
$serviceDef = new DefinitionDecorator($abstractId);
|
||||
$serviceDef->replaceArgument(0, $typeDef);
|
||||
$serviceDef->replaceArgument(1, new Reference($transformerId));
|
||||
|
@ -285,8 +285,8 @@ class FOQElasticaExtension extends Extension
|
|||
if (isset($typeConfig['provider']['service'])) {
|
||||
return $typeConfig['provider']['service'];
|
||||
}
|
||||
$abstractProviderId = sprintf('foq_elastica.provider.prototype.%s', $typeConfig['driver']);
|
||||
$providerId = sprintf('foq_elastica.provider.%s.%s', $indexName, $typeName);
|
||||
$abstractProviderId = sprintf('fos_elastica.provider.prototype.%s', $typeConfig['driver']);
|
||||
$providerId = sprintf('fos_elastica.provider.%s.%s', $indexName, $typeName);
|
||||
$providerDef = new DefinitionDecorator($abstractProviderId);
|
||||
$providerDef->replaceArgument(0, $typeDef);
|
||||
|
||||
|
@ -314,8 +314,8 @@ class FOQElasticaExtension extends Extension
|
|||
if (isset($typeConfig['listener']['service'])) {
|
||||
return $typeConfig['listener']['service'];
|
||||
}
|
||||
$abstractListenerId = sprintf('foq_elastica.listener.prototype.%s', $typeConfig['driver']);
|
||||
$listenerId = sprintf('foq_elastica.listener.%s.%s', $indexName, $typeName);
|
||||
$abstractListenerId = sprintf('fos_elastica.listener.prototype.%s', $typeConfig['driver']);
|
||||
$listenerId = sprintf('fos_elastica.listener.%s.%s', $indexName, $typeName);
|
||||
$listenerDef = new DefinitionDecorator($abstractListenerId);
|
||||
$listenerDef->replaceArgument(0, new Reference($objectPersisterId));
|
||||
$listenerDef->replaceArgument(1, $typeConfig['model']);
|
||||
|
@ -353,14 +353,14 @@ class FOQElasticaExtension extends Extension
|
|||
if (isset($typeConfig['finder']['service'])) {
|
||||
return $typeConfig['finder']['service'];
|
||||
}
|
||||
$abstractFinderId = 'foq_elastica.finder.prototype';
|
||||
$finderId = sprintf('foq_elastica.finder.%s.%s', $indexName, $typeName);
|
||||
$abstractFinderId = 'fos_elastica.finder.prototype';
|
||||
$finderId = sprintf('fos_elastica.finder.%s.%s', $indexName, $typeName);
|
||||
$finderDef = new DefinitionDecorator($abstractFinderId);
|
||||
$finderDef->replaceArgument(0, $typeDef);
|
||||
$finderDef->replaceArgument(1, new Reference($elasticaToModelId));
|
||||
$container->setDefinition($finderId, $finderDef);
|
||||
|
||||
$managerId = sprintf('foq_elastica.manager.%s', $typeConfig['driver']);
|
||||
$managerId = sprintf('fos_elastica.manager.%s', $typeConfig['driver']);
|
||||
$managerDef = $container->getDefinition($managerId);
|
||||
$arguments = array( $typeConfig['model'], new Reference($finderId));
|
||||
if (isset($typeConfig['repository'])) {
|
||||
|
@ -379,9 +379,9 @@ class FOQElasticaExtension extends Extension
|
|||
**/
|
||||
protected function loadIndexManager(array $indexDefs, $defaultIndexId, ContainerBuilder $container)
|
||||
{
|
||||
$managerDef = $container->getDefinition('foq_elastica.index_manager');
|
||||
$managerDef = $container->getDefinition('fos_elastica.index_manager');
|
||||
$managerDef->replaceArgument(0, $indexDefs);
|
||||
$managerDef->replaceArgument(1, new Reference('foq_elastica.index'));
|
||||
$managerDef->replaceArgument(1, new Reference('fos_elastica.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -391,7 +391,7 @@ class FOQElasticaExtension extends Extension
|
|||
**/
|
||||
protected function loadReseter(array $indexConfigs, ContainerBuilder $container)
|
||||
{
|
||||
$reseterDef = $container->getDefinition('foq_elastica.reseter');
|
||||
$reseterDef = $container->getDefinition('fos_elastica.reseter');
|
||||
$reseterDef->replaceArgument(0, $indexConfigs);
|
||||
}
|
||||
|
||||
|
@ -419,7 +419,7 @@ class FOQElasticaExtension extends Extension
|
|||
$defaultManagerService = $this->loadedDrivers[0];
|
||||
}
|
||||
|
||||
$container->setAlias('foq_elastica.manager', sprintf('foq_elastica.manager.%s', $defaultManagerService));
|
||||
$container->setAlias('fos_elastica.manager', sprintf('fos_elastica.manager.%s', $defaultManagerService));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine;
|
||||
namespace FOS\ElasticaBundle\Doctrine;
|
||||
|
||||
use FOQ\ElasticaBundle\HybridResult;
|
||||
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use FOQ\ElasticaBundle\Transformer\HighlightableModelInterface;
|
||||
use FOS\ElasticaBundle\HybridResult;
|
||||
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use FOS\ElasticaBundle\Transformer\HighlightableModelInterface;
|
||||
use Elastica_Document;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine;
|
||||
namespace FOS\ElasticaBundle\Doctrine;
|
||||
|
||||
use FOQ\ElasticaBundle\Persister\ObjectPersisterInterface;
|
||||
use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
|
||||
use Symfony\Component\HttpKernel\Log\LoggerInterface;
|
||||
|
||||
abstract class AbstractListener
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine;
|
||||
namespace FOS\ElasticaBundle\Doctrine;
|
||||
|
||||
use FOQ\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOQ\ElasticaBundle\Persister\ObjectPersisterInterface;
|
||||
use FOS\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
|
||||
use Elastica_Type;
|
||||
use Elastica_Document;
|
||||
use Closure;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine\MongoDB;
|
||||
namespace FOS\ElasticaBundle\Doctrine\MongoDB;
|
||||
|
||||
use FOQ\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer;
|
||||
use FOS\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer;
|
||||
use Elastica_Document;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine\MongoDB;
|
||||
namespace FOS\ElasticaBundle\Doctrine\MongoDB;
|
||||
|
||||
use FOQ\ElasticaBundle\Doctrine\AbstractListener;
|
||||
use FOS\ElasticaBundle\Doctrine\AbstractListener;
|
||||
use Doctrine\ODM\MongoDB\Event\LifecycleEventArgs;
|
||||
use Doctrine\Common\EventSubscriber;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine\MongoDB;
|
||||
namespace FOS\ElasticaBundle\Doctrine\MongoDB;
|
||||
|
||||
use FOQ\ElasticaBundle\Doctrine\AbstractProvider;
|
||||
use FOS\ElasticaBundle\Doctrine\AbstractProvider;
|
||||
|
||||
class Provider extends AbstractProvider
|
||||
{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine\ORM;
|
||||
namespace FOS\ElasticaBundle\Doctrine\ORM;
|
||||
|
||||
use FOQ\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer;
|
||||
use FOS\ElasticaBundle\Doctrine\AbstractElasticaToModelTransformer;
|
||||
use Elastica_Document;
|
||||
use Doctrine\ORM\Query;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine\ORM;
|
||||
namespace FOS\ElasticaBundle\Doctrine\ORM;
|
||||
|
||||
use FOQ\ElasticaBundle\Doctrine\AbstractListener;
|
||||
use FOS\ElasticaBundle\Doctrine\AbstractListener;
|
||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||
use Doctrine\Common\EventSubscriber;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Doctrine\ORM;
|
||||
namespace FOS\ElasticaBundle\Doctrine\ORM;
|
||||
|
||||
use FOQ\ElasticaBundle\Doctrine\AbstractProvider;
|
||||
use FOS\ElasticaBundle\Doctrine\AbstractProvider;
|
||||
|
||||
class Provider extends AbstractProvider
|
||||
{
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
use FOQ\ElasticaBundle\DependencyInjection\Compiler\AddProviderPass;
|
||||
use FOQ\ElasticaBundle\DependencyInjection\Compiler\TransformerPass;
|
||||
use FOS\ElasticaBundle\DependencyInjection\Compiler\AddProviderPass;
|
||||
use FOS\ElasticaBundle\DependencyInjection\Compiler\TransformerPass;
|
||||
|
||||
class FOQElasticaBundle extends Bundle
|
||||
class FOSElasticaBundle extends Bundle
|
||||
{
|
||||
public function build(ContainerBuilder $container)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Finder;
|
||||
namespace FOS\ElasticaBundle\Finder;
|
||||
|
||||
interface FinderInterface
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Finder;
|
||||
namespace FOS\ElasticaBundle\Finder;
|
||||
|
||||
use Pagerfanta\Pagerfanta;
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Finder;
|
||||
namespace FOS\ElasticaBundle\Finder;
|
||||
|
||||
use FOQ\ElasticaBundle\Finder\FinderInterface;
|
||||
use FOQ\ElasticaBundle\Finder\PaginatedFinderInterface;
|
||||
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use FOQ\ElasticaBundle\Paginator\TransformedPaginatorAdapter;
|
||||
use FOS\ElasticaBundle\Finder\FinderInterface;
|
||||
use FOS\ElasticaBundle\Finder\PaginatedFinderInterface;
|
||||
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use FOS\ElasticaBundle\Paginator\TransformedPaginatorAdapter;
|
||||
use Pagerfanta\Pagerfanta;
|
||||
use Elastica_Searchable;
|
||||
use Elastica_Query;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
use Elastica_Result;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Logger;
|
||||
namespace FOS\ElasticaBundle\Logger;
|
||||
|
||||
use Symfony\Component\HttpKernel\Log\LoggerInterface;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Manager;
|
||||
namespace FOS\ElasticaBundle\Manager;
|
||||
|
||||
use Doctrine\Common\Annotations\Reader;
|
||||
use FOQ\ElasticaBundle\Finder\FinderInterface;
|
||||
use FOS\ElasticaBundle\Finder\FinderInterface;
|
||||
use RuntimeException;
|
||||
/**
|
||||
* @author Richard Miller <info@limethinking.co.uk>
|
||||
|
@ -58,14 +58,14 @@ class RepositoryManager implements RepositoryManagerInterface
|
|||
}
|
||||
|
||||
$refClass = new \ReflectionClass($entityName);
|
||||
$annotation = $this->reader->getClassAnnotation($refClass, 'FOQ\\ElasticaBundle\\Configuration\\Search');
|
||||
$annotation = $this->reader->getClassAnnotation($refClass, 'FOS\\ElasticaBundle\\Configuration\\Search');
|
||||
if ($annotation) {
|
||||
$this->entities[$entityName]['repositoryName']
|
||||
= $annotation->repositoryClass;
|
||||
return $annotation->repositoryClass;
|
||||
}
|
||||
|
||||
return 'FOQ\ElasticaBundle\Repository';
|
||||
return 'FOS\ElasticaBundle\Repository';
|
||||
}
|
||||
|
||||
private function createRepository($entityName)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Manager;
|
||||
namespace FOS\ElasticaBundle\Manager;
|
||||
|
||||
use FOQ\ElasticaBundle\Finder\FinderInterface;
|
||||
use FOS\ElasticaBundle\Finder\FinderInterface;
|
||||
|
||||
/**
|
||||
* @author Richard Miller <info@limethinking.co.uk>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
use Elastica_Type;
|
||||
use InvalidArgumentException;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Paginator;
|
||||
namespace FOS\ElasticaBundle\Paginator;
|
||||
|
||||
use Pagerfanta\Adapter\AdapterInterface;
|
||||
use Elastica_Searchable;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Paginator;
|
||||
namespace FOS\ElasticaBundle\Paginator;
|
||||
|
||||
/**
|
||||
* Implements the Pagerfanta\Adapter\AdapterInterface for use with Zend\Paginator\Paginator
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Paginator;
|
||||
namespace FOS\ElasticaBundle\Paginator;
|
||||
|
||||
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use Elastica_Searchable;
|
||||
use Elastica_Query;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Persister;
|
||||
namespace FOS\ElasticaBundle\Persister;
|
||||
|
||||
use FOQ\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOQ\ElasticaBundle\Transformer\ModelToElasticaTransformerInterface;
|
||||
use FOS\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOS\ElasticaBundle\Transformer\ModelToElasticaTransformerInterface;
|
||||
use Symfony\Component\HttpKernel\Log\LoggerInterface;
|
||||
use Elastica_Type;
|
||||
use Elastica_Document;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Persister;
|
||||
namespace FOS\ElasticaBundle\Persister;
|
||||
|
||||
/**
|
||||
* Inserts, replaces and deletes single documents in an elastica type
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
use FOQ\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOS\ElasticaBundle\Provider\ProviderInterface;
|
||||
use Closure;
|
||||
|
||||
class Populator
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Propel;
|
||||
namespace FOS\ElasticaBundle\Propel;
|
||||
|
||||
use FOQ\ElasticaBundle\HybridResult;
|
||||
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use FOS\ElasticaBundle\HybridResult;
|
||||
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
|
||||
use Elastica_Document;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Propel;
|
||||
namespace FOS\ElasticaBundle\Propel;
|
||||
|
||||
use FOQ\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOQ\ElasticaBundle\Persister\ObjectPersisterInterface;
|
||||
use FOS\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOS\ElasticaBundle\Persister\ObjectPersisterInterface;
|
||||
use Elastica_Type;
|
||||
use Elastica_Document;
|
||||
use Closure;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Provider;
|
||||
namespace FOS\ElasticaBundle\Provider;
|
||||
|
||||
use Closure;
|
||||
|
||||
|
|
112
README.md
112
README.md
|
@ -43,25 +43,25 @@ Use the master branch with Symfony2 master only, use the 2.0 branch with Symfony
|
|||
|
||||
**With submodule**
|
||||
|
||||
`git submodule add git://github.com/Exercise/FOQElasticaBundle vendor/bundles/FOQ/ElasticaBundle`
|
||||
`git submodule add git://github.com/Exercise/FOSElasticaBundle vendor/bundles/FOS/ElasticaBundle`
|
||||
|
||||
**With clone**
|
||||
|
||||
`git clone git://github.com/Exercise/FOQElasticaBundle vendor/bundles/FOQ/ElasticaBundle`
|
||||
`git clone git://github.com/Exercise/FOSElasticaBundle vendor/bundles/FOS/ElasticaBundle`
|
||||
|
||||
**With the vendors script**
|
||||
|
||||
Add the following lines to your deps file:
|
||||
|
||||
[FOQElasticaBundle]
|
||||
git=git://github.com/Exercise/FOQElasticaBundle.git
|
||||
target=bundles/FOQ/ElasticaBundle
|
||||
[FOSElasticaBundle]
|
||||
git=git://github.com/Exercise/FOSElasticaBundle.git
|
||||
target=bundles/FOS/ElasticaBundle
|
||||
|
||||
For the 2.0 branch for use with Symfony2.0.x releases add the following:
|
||||
|
||||
[FOQElasticaBundle]
|
||||
git=git://github.com/Exercise/FOQElasticaBundle.git
|
||||
target=bundles/FOQ/ElasticaBundle
|
||||
[FOSElasticaBundle]
|
||||
git=git://github.com/Exercise/FOSElasticaBundle.git
|
||||
target=bundles/FOS/ElasticaBundle
|
||||
version=origin/2.0
|
||||
|
||||
Run the vendors script:
|
||||
|
@ -75,7 +75,7 @@ $ php bin/vendors install
|
|||
|
||||
$loader->registerNamespaces(array(
|
||||
...
|
||||
'FOQ' => __DIR__.'/../vendor/bundles',
|
||||
'FOS' => __DIR__.'/../vendor/bundles',
|
||||
));
|
||||
|
||||
#### Register the bundle
|
||||
|
@ -86,7 +86,7 @@ $ php bin/vendors install
|
|||
{
|
||||
return array(
|
||||
// ...
|
||||
new FOQ\ElasticaBundle\FOQElasticaBundle(),
|
||||
new FOS\ElasticaBundle\FOSElasticaBundle(),
|
||||
// ...
|
||||
);
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ Elasticsearch client is comparable to a database connection.
|
|||
Most of the time, you will need only one.
|
||||
|
||||
#app/config/config.yml
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
|
||||
|
@ -108,7 +108,7 @@ Most of the time, you will need only one.
|
|||
Elasticsearch index is comparable to Doctrine entity manager.
|
||||
Most of the time, you will need only one.
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
indexes:
|
||||
|
@ -117,13 +117,13 @@ Most of the time, you will need only one.
|
|||
|
||||
Here we created a "website" index, that uses our "default" client.
|
||||
|
||||
Our index is now available as a service: `foq_elastica.index.website`. It is an instance of `Elastica_Index`.
|
||||
Our index is now available as a service: `fos_elastica.index.website`. It is an instance of `Elastica_Index`.
|
||||
|
||||
#### Declare a type
|
||||
|
||||
Elasticsearch type is comparable to Doctrine entity repository.
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
indexes:
|
||||
|
@ -137,11 +137,11 @@ Elasticsearch type is comparable to Doctrine entity repository.
|
|||
lastName: { boost: 3 }
|
||||
aboutMe:
|
||||
|
||||
Our type is now available as a service: `foq_elastica.index.website.user`. It is an instance of `Elastica_Type`.
|
||||
Our type is now available as a service: `fos_elastica.index.website.user`. It is an instance of `Elastica_Type`.
|
||||
|
||||
### Populate the types
|
||||
|
||||
php app/console foq:elastica:populate
|
||||
php app/console fos:elastica:populate
|
||||
|
||||
This command deletes and creates the declared indexes and types.
|
||||
It applies the configured mappings to the types.
|
||||
|
@ -156,7 +156,7 @@ Or, for complete flexibility, go for manual provider.
|
|||
If we want to index the entities from a Doctrine repository or a Propel query,
|
||||
some configuration will let ElasticaBundle do it for us.
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
indexes:
|
||||
|
@ -213,20 +213,20 @@ You can change this value in the provider configuration.
|
|||
|
||||
#### Manual provider
|
||||
|
||||
Create a service with the tag "foq_elastica.provider".
|
||||
Create a service with the tag "fos_elastica.provider".
|
||||
|
||||
<service id="acme.search_provider.user" class="Acme\UserBundle\Search\UserProvider">
|
||||
<tag name="foq_elastica.provider" />
|
||||
<argument type="service" id="foq_elastica.index.website.user" />
|
||||
<tag name="fos_elastica.provider" />
|
||||
<argument type="service" id="fos_elastica.index.website.user" />
|
||||
</service>
|
||||
|
||||
Its class must implement `FOQ\ElasticaBundle\Provider\ProviderInterface`.
|
||||
Its class must implement `FOS\ElasticaBundle\Provider\ProviderInterface`.
|
||||
|
||||
<?php
|
||||
|
||||
namespace Acme\UserBundle\Provider;
|
||||
|
||||
use FOQ\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOS\ElasticaBundle\Provider\ProviderInterface;
|
||||
use Elastica_Type;
|
||||
|
||||
class UserProvider implements ProviderInterface
|
||||
|
@ -253,14 +253,14 @@ Its class must implement `FOQ\ElasticaBundle\Provider\ProviderInterface`.
|
|||
}
|
||||
}
|
||||
|
||||
You will find a more complete implementation example in `src/FOQ/ElasticaBundle/Doctrine/AbstractProvider.php`.
|
||||
You will find a more complete implementation example in `src/FOS/ElasticaBundle/Doctrine/AbstractProvider.php`.
|
||||
|
||||
### Search
|
||||
|
||||
You can just use the index and type Elastica objects, provided as services, to perform searches.
|
||||
|
||||
/** var Elastica_Type */
|
||||
$userType = $this->container->get('foq_elastica.index.website.user');
|
||||
$userType = $this->container->get('fos_elastica.index.website.user');
|
||||
|
||||
/** var Elastica_ResultSet */
|
||||
$resultSet = $userType->search('bob');
|
||||
|
@ -271,7 +271,7 @@ If your elasticsearch type is bound to a Doctrine entity repository or a Propel
|
|||
you can get your entities instead of Elastica results when you perform a search.
|
||||
Declare that you want a Doctrine/Propel finder in your configuration:
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
indexes:
|
||||
|
@ -287,10 +287,10 @@ Declare that you want a Doctrine/Propel finder in your configuration:
|
|||
provider:
|
||||
finder:
|
||||
|
||||
You can now use the `foq_elastica.finder.website.user` service:
|
||||
You can now use the `fos_elastica.finder.website.user` service:
|
||||
|
||||
/** var FOQ\ElasticaBundle\Finder\TransformedFinder */
|
||||
$finder = $container->get('foq_elastica.finder.website.user');
|
||||
/** var FOS\ElasticaBundle\Finder\TransformedFinder */
|
||||
$finder = $container->get('fos_elastica.finder.website.user');
|
||||
|
||||
/** var array of Acme\UserBundle\Entity\User */
|
||||
$users = $finder->find('bob');
|
||||
|
@ -307,7 +307,7 @@ You can also get both the Elastica results and the entities together from the fi
|
|||
YOu can then access the score, highlights etc. from the Elastica_Result whilst
|
||||
still also getting the entity.
|
||||
|
||||
/** var array of FOQ\ElasticaBundle\HybridResult */
|
||||
/** var array of FOS\ElasticaBundle\HybridResult */
|
||||
$hybridResults = $finder->findHybrid('bob');
|
||||
foreach ($hybridResults as $hybridResult) {
|
||||
|
||||
|
@ -324,16 +324,16 @@ still also getting the entity.
|
|||
You can also define a finder that will work on the entire index. Adjust your index
|
||||
configuration as per below:
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
indexes:
|
||||
website:
|
||||
client: default
|
||||
finder:
|
||||
|
||||
You can now use the index wide finder service `foq_elastica.finder.website`:
|
||||
You can now use the index wide finder service `fos_elastica.finder.website`:
|
||||
|
||||
/** var FOQ\ElasticaBundle\Finder\MappedFinder */
|
||||
$finder = $container->get('foq_elastica.finder.website');
|
||||
/** var FOS\ElasticaBundle\Finder\MappedFinder */
|
||||
$finder = $container->get('fos_elastica.finder.website');
|
||||
|
||||
// Returns a mixed array of any objects mapped
|
||||
$results = $finder->find('bob');
|
||||
|
@ -345,10 +345,10 @@ can use a manager service for each driver and get a repository for an entity to
|
|||
against. This allows you to use the same service rather than the particular finder. For
|
||||
example:
|
||||
|
||||
/** var FOQ\ElasticaBundle\Manager\RepositoryManager */
|
||||
$repositoryManager = $container->get('foq_elastica.manager.orm');
|
||||
/** var FOS\ElasticaBundle\Manager\RepositoryManager */
|
||||
$repositoryManager = $container->get('fos_elastica.manager.orm');
|
||||
|
||||
/** var FOQ\ElasticaBundle\Repository */
|
||||
/** var FOS\ElasticaBundle\Repository */
|
||||
$repository = $repositoryManager->getRepository('UserBundle:User');
|
||||
|
||||
/** var array of Acme\UserBundle\Entity\User */
|
||||
|
@ -356,7 +356,7 @@ example:
|
|||
|
||||
You can also specify the full name of the entity instead of the shortcut syntax:
|
||||
|
||||
/** var FOQ\ElasticaBundle\Repository */
|
||||
/** var FOS\ElasticaBundle\Repository */
|
||||
$repository = $repositoryManager->getRepository('Application\UserBundle\Entity\User');
|
||||
|
||||
> The **2.0** branch doesn't support using `UserBundle:User` style syntax and you must use the full name of the entity. .
|
||||
|
@ -364,21 +364,21 @@ You can also specify the full name of the entity instead of the shortcut syntax:
|
|||
##### Default Manager
|
||||
|
||||
If you are only using one driver then its manager service is automatically aliased
|
||||
to `foq_elastica.manager`. So the above example could be simplified to:
|
||||
to `fos_elastica.manager`. So the above example could be simplified to:
|
||||
|
||||
/** var FOQ\ElasticaBundle\Manager\RepositoryManager */
|
||||
$repositoryManager = $container->get('foq_elastica.manager');
|
||||
/** var FOS\ElasticaBundle\Manager\RepositoryManager */
|
||||
$repositoryManager = $container->get('fos_elastica.manager');
|
||||
|
||||
/** var FOQ\ElasticaBundle\Repository */
|
||||
/** var FOS\ElasticaBundle\Repository */
|
||||
$repository = $repositoryManager->getRepository('UserBundle:User');
|
||||
|
||||
/** var array of Acme\UserBundle\Entity\User */
|
||||
$users = $finder->find('bob');
|
||||
|
||||
If you use multiple drivers then you can choose which one is aliased to `foq_elastica.manager`
|
||||
If you use multiple drivers then you can choose which one is aliased to `fos_elastica.manager`
|
||||
using the `default_manager` parameter:
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
default_manager: mongodb #defauults to orm
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
|
@ -387,7 +387,7 @@ using the `default_manager` parameter:
|
|||
##### Custom Repositories
|
||||
|
||||
As well as the default repository you can create a custom repository for an entity and add
|
||||
methods for particular searches. These need to extend `FOQ\ElasticaBundle\Repository` to have
|
||||
methods for particular searches. These need to extend `FOS\ElasticaBundle\Repository` to have
|
||||
access to the finder:
|
||||
|
||||
```
|
||||
|
@ -395,7 +395,7 @@ access to the finder:
|
|||
|
||||
namespace Acme\ElasticaBundle\SearchRepository;
|
||||
|
||||
use FOQ\ElasticaBundle\Repository;
|
||||
use FOS\ElasticaBundle\Repository;
|
||||
|
||||
class UserRepository extends Repository
|
||||
{
|
||||
|
@ -409,7 +409,7 @@ class UserRepository extends Repository
|
|||
|
||||
To use the custom repository specify it in the mapping for the entity:
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
indexes:
|
||||
|
@ -428,10 +428,10 @@ To use the custom repository specify it in the mapping for the entity:
|
|||
|
||||
Then the custom queries will be available when using the repository returned from the manager:
|
||||
|
||||
/** var FOQ\ElasticaBundle\Manager\RepositoryManager */
|
||||
$repositoryManager = $container->get('foq_elastica.manager');
|
||||
/** var FOS\ElasticaBundle\Manager\RepositoryManager */
|
||||
$repositoryManager = $container->get('fos_elastica.manager');
|
||||
|
||||
/** var FOQ\ElasticaBundle\Repository */
|
||||
/** var FOS\ElasticaBundle\Repository */
|
||||
$repository = $repositoryManager->getRepository('UserBundle:User');
|
||||
|
||||
/** var array of Acme\UserBundle\Entity\User */
|
||||
|
@ -444,7 +444,7 @@ Alternatively you can specify the custom repository using an annotation in the e
|
|||
|
||||
namespace Application\UserBundle\Entity;
|
||||
|
||||
use FOQ\ElasticaBundle\Configuration\Search;
|
||||
use FOS\ElasticaBundle\Configuration\Search;
|
||||
|
||||
/**
|
||||
* @Search(repositoryClass="Acme\ElasticaBundle\SearchRepository\UserRepository")
|
||||
|
@ -463,7 +463,7 @@ If you use the Doctrine integration, you can let ElasticaBundle update the index
|
|||
when an object is added, updated or removed. It uses Doctrine lifecycle events.
|
||||
Declare that you want to update the index in real time:
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
indexes:
|
||||
|
@ -495,7 +495,7 @@ You can also choose to only listen for some of the events:
|
|||
|
||||
Any setting can be specified when declaring a type. For example, to enable a custom analyzer, you could write:
|
||||
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
indexes:
|
||||
doc:
|
||||
settings:
|
||||
|
@ -524,7 +524,7 @@ issuing a request will result in an `Elastica_Exception_Client` being thrown.
|
|||
Depending on your needs, it may be desirable to suppress these exceptions and
|
||||
allow searches to fail silently.
|
||||
|
||||
One way to achieve this is to override the `foq_elastica.client.class` service
|
||||
One way to achieve this is to override the `fos_elastica.client.class` service
|
||||
container parameter with a custom class. In the following example, we override
|
||||
the `Client::request()` method and return the equivalent of an empty search
|
||||
response if an exception occurred.
|
||||
|
@ -534,7 +534,7 @@ response if an exception occurred.
|
|||
|
||||
namespace Acme\ElasticaBundle;
|
||||
|
||||
use FOQ\ElasticaBundle\Client as BaseClient;
|
||||
use FOS\ElasticaBundle\Client as BaseClient;
|
||||
|
||||
class Client extends BaseClient
|
||||
{
|
||||
|
@ -560,7 +560,7 @@ Results must match at least one specified `categoryIds`, and should match the
|
|||
apply to queries against the `title` field.
|
||||
|
||||
```php
|
||||
$finder = $this->container->get('foq_elastica.finder.website.article');
|
||||
$finder = $this->container->get('fos_elastica.finder.website.article');
|
||||
$boolQuery = new \Elastica_Query_Bool();
|
||||
|
||||
$fieldQuery = new \Elastica_Query_Text();
|
||||
|
@ -582,7 +582,7 @@ $data = $finder->find($boolQuery);
|
|||
Configuration:
|
||||
|
||||
```yaml
|
||||
foq_elastica:
|
||||
fos_elastica:
|
||||
clients:
|
||||
default: { host: localhost, port: 9200 }
|
||||
indexes:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
/**
|
||||
* @author Richard Miller <info@limethinking.co.uk>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle;
|
||||
namespace FOS\ElasticaBundle;
|
||||
|
||||
use Elastica_Exception_Response;
|
||||
|
||||
|
|
|
@ -5,64 +5,64 @@
|
|||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||
|
||||
<parameters>
|
||||
<parameter key="foq_elastica.client.class">FOQ\ElasticaBundle\Client</parameter>
|
||||
<parameter key="foq_elastica.index.class">Elastica_Index</parameter>
|
||||
<parameter key="foq_elastica.type.class">Elastica_Type</parameter>
|
||||
<parameter key="foq_elastica.logger.class">FOQ\ElasticaBundle\Logger\ElasticaLogger</parameter>
|
||||
<parameter key="foq_elastica.data_collector.class">FOQ\ElasticaBundle\DataCollector\ElasticaDataCollector</parameter>
|
||||
<parameter key="foq_elastica.manager.class">FOQ\ElasticaBundle\Manager\RepositoryManager</parameter>
|
||||
<parameter key="foq_elastica.elastica_to_model_transformer.collection.class">FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection</parameter>
|
||||
<parameter key="fos_elastica.client.class">FOS\ElasticaBundle\Client</parameter>
|
||||
<parameter key="fos_elastica.index.class">Elastica_Index</parameter>
|
||||
<parameter key="fos_elastica.type.class">Elastica_Type</parameter>
|
||||
<parameter key="fos_elastica.logger.class">FOS\ElasticaBundle\Logger\ElasticaLogger</parameter>
|
||||
<parameter key="fos_elastica.data_collector.class">FOS\ElasticaBundle\DataCollector\ElasticaDataCollector</parameter>
|
||||
<parameter key="fos_elastica.manager.class">FOS\ElasticaBundle\Manager\RepositoryManager</parameter>
|
||||
<parameter key="fos_elastica.elastica_to_model_transformer.collection.class">FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection</parameter>
|
||||
</parameters>
|
||||
|
||||
<services>
|
||||
|
||||
<service id="foq_elastica.logger" class="%foq_elastica.logger.class%">
|
||||
<service id="fos_elastica.logger" class="%fos_elastica.logger.class%">
|
||||
<argument type="service" id="logger" on-invalid="null" />
|
||||
<argument>%kernel.debug%</argument>
|
||||
<tag name="monolog.logger" channel="elastica" />
|
||||
</service>
|
||||
<service id="foq_elastica.data_collector" class="%foq_elastica.data_collector.class%" public="true">
|
||||
<tag name="data_collector" template="FOQElasticaBundle:Collector:elastica" id="elastica" />
|
||||
<argument type="service" id="foq_elastica.logger" />
|
||||
<service id="fos_elastica.data_collector" class="%fos_elastica.data_collector.class%" public="true">
|
||||
<tag name="data_collector" template="FOSElasticaBundle:Collector:elastica" id="elastica" />
|
||||
<argument type="service" id="fos_elastica.logger" />
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.client" class="%foq_elastica.client.class%">
|
||||
<service id="fos_elastica.client" class="%fos_elastica.client.class%">
|
||||
<argument /> <!-- config -->
|
||||
<call method="setLogger">
|
||||
<argument type="service" id="foq_elastica.logger" />
|
||||
<argument type="service" id="fos_elastica.logger" />
|
||||
</call>
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.index_manager" class="FOQ\ElasticaBundle\IndexManager">
|
||||
<service id="fos_elastica.index_manager" class="FOS\ElasticaBundle\IndexManager">
|
||||
<argument /> <!-- indexes -->
|
||||
<argument /> <!-- default index -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.populator" class="FOQ\ElasticaBundle\Populator">
|
||||
<service id="fos_elastica.populator" class="FOS\ElasticaBundle\Populator">
|
||||
<argument /> <!-- providers -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.reseter" class="FOQ\ElasticaBundle\Reseter">
|
||||
<service id="fos_elastica.reseter" class="FOS\ElasticaBundle\Reseter">
|
||||
<argument /> <!-- index configs -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.object_persister.prototype" class="FOQ\ElasticaBundle\Persister\ObjectPersister" abstract="true">
|
||||
<service id="fos_elastica.object_persister.prototype" class="FOS\ElasticaBundle\Persister\ObjectPersister" abstract="true">
|
||||
<argument /> <!-- type -->
|
||||
<argument /> <!-- model to elastica transformer -->
|
||||
<argument /> <!-- model -->
|
||||
<argument /> <!-- properties mapping -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.finder.prototype" class="FOQ\ElasticaBundle\Finder\TransformedFinder" public="true" abstract="true">
|
||||
<service id="fos_elastica.finder.prototype" class="FOS\ElasticaBundle\Finder\TransformedFinder" public="true" abstract="true">
|
||||
<argument /> <!-- searchable -->
|
||||
<argument /> <!-- transformer -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.model_to_elastica_transformer.prototype.auto" class="FOQ\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer" public="false" abstract="true">
|
||||
<service id="fos_elastica.model_to_elastica_transformer.prototype.auto" class="FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer" public="false" abstract="true">
|
||||
<argument /> <!-- options -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.elastica_to_model_transformer.collection.prototype" class="%foq_elastica.elastica_to_model_transformer.collection.class%" public="true" abstract="true">
|
||||
<service id="fos_elastica.elastica_to_model_transformer.collection.prototype" class="%fos_elastica.elastica_to_model_transformer.collection.class%" public="true" abstract="true">
|
||||
<argument type="collection" /> <!-- transformers -->
|
||||
</service>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<services>
|
||||
|
||||
<service id="foq_elastica.provider.prototype.mongodb" class="FOQ\ElasticaBundle\Doctrine\MongoDB\Provider" public="false" abstract="true">
|
||||
<service id="fos_elastica.provider.prototype.mongodb" class="FOS\ElasticaBundle\Doctrine\MongoDB\Provider" public="false" abstract="true">
|
||||
<argument /> <!-- type -->
|
||||
<argument type="service" id="doctrine.odm.mongodb.document_manager" />
|
||||
<argument /> <!-- object persister -->
|
||||
|
@ -14,20 +14,20 @@
|
|||
<argument type="collection" /> <!-- options -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.listener.prototype.mongodb" class="FOQ\ElasticaBundle\Doctrine\MongoDB\Listener" public="false" abstract="true">
|
||||
<service id="fos_elastica.listener.prototype.mongodb" class="FOS\ElasticaBundle\Doctrine\MongoDB\Listener" public="false" abstract="true">
|
||||
<argument /> <!-- object persister -->
|
||||
<argument /> <!-- model -->
|
||||
<argument type="collection" /> <!-- events -->
|
||||
<argument/> <!-- identifier -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.elastica_to_model_transformer.prototype.mongodb" class="FOQ\ElasticaBundle\Doctrine\MongoDB\ElasticaToModelTransformer" public="false">
|
||||
<service id="fos_elastica.elastica_to_model_transformer.prototype.mongodb" class="FOS\ElasticaBundle\Doctrine\MongoDB\ElasticaToModelTransformer" public="false">
|
||||
<argument type="service" id="doctrine.odm.mongodb.document_manager" />
|
||||
<argument /> <!-- model -->
|
||||
<argument type="collection" /> <!-- options -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.manager.mongodb" class="%foq_elastica.manager.class%">
|
||||
<service id="fos_elastica.manager.mongodb" class="%fos_elastica.manager.class%">
|
||||
<argument type="service" id="annotation_reader"/>
|
||||
</service>
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<services>
|
||||
|
||||
<service id="foq_elastica.provider.prototype.orm" class="FOQ\ElasticaBundle\Doctrine\ORM\Provider" public="false" abstract="true">
|
||||
<service id="fos_elastica.provider.prototype.orm" class="FOS\ElasticaBundle\Doctrine\ORM\Provider" public="false" abstract="true">
|
||||
<argument /> <!-- type -->
|
||||
<argument type="service" id="doctrine.orm.entity_manager" />
|
||||
<argument /> <!-- object persister -->
|
||||
|
@ -14,20 +14,20 @@
|
|||
<argument type="collection" /> <!-- options -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.listener.prototype.orm" class="FOQ\ElasticaBundle\Doctrine\ORM\Listener" public="false" abstract="true">
|
||||
<service id="fos_elastica.listener.prototype.orm" class="FOS\ElasticaBundle\Doctrine\ORM\Listener" public="false" abstract="true">
|
||||
<argument /> <!-- object persister -->
|
||||
<argument /> <!-- model -->
|
||||
<argument type="collection" /> <!-- events -->
|
||||
<argument/> <!-- identifier -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.elastica_to_model_transformer.prototype.orm" class="FOQ\ElasticaBundle\Doctrine\ORM\ElasticaToModelTransformer" public="false">
|
||||
<service id="fos_elastica.elastica_to_model_transformer.prototype.orm" class="FOS\ElasticaBundle\Doctrine\ORM\ElasticaToModelTransformer" public="false">
|
||||
<argument type="service" id="doctrine.orm.entity_manager" />
|
||||
<argument /> <!-- model -->
|
||||
<argument type="collection" /> <!-- options -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.manager.orm" class="%foq_elastica.manager.class%">
|
||||
<service id="fos_elastica.manager.orm" class="%fos_elastica.manager.class%">
|
||||
<argument type="service" id="annotation_reader"/>
|
||||
</service>
|
||||
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
|
||||
<services>
|
||||
|
||||
<service id="foq_elastica.provider.prototype.propel" class="FOQ\ElasticaBundle\Propel\Provider" public="false" abstract="true">
|
||||
<service id="fos_elastica.provider.prototype.propel" class="FOS\ElasticaBundle\Propel\Provider" public="false" abstract="true">
|
||||
<argument /> <!-- type -->
|
||||
<argument /> <!-- object persister -->
|
||||
<argument /> <!-- model -->
|
||||
<argument type="collection" /> <!-- options -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.elastica_to_model_transformer.prototype.propel" class="FOQ\ElasticaBundle\Propel\ElasticaToModelTransformer" public="false">
|
||||
<service id="fos_elastica.elastica_to_model_transformer.prototype.propel" class="FOS\ElasticaBundle\Propel\ElasticaToModelTransformer" public="false">
|
||||
<argument /> <!-- model -->
|
||||
<argument type="collection" /> <!-- options -->
|
||||
</service>
|
||||
|
||||
<service id="foq_elastica.manager.propel" class="%foq_elastica.manager.class%">
|
||||
<service id="fos_elastica.manager.propel" class="%fos_elastica.manager.class%">
|
||||
<argument type="service" id="annotation_reader"/>
|
||||
</service>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
{% block menu %}
|
||||
<span class="label">
|
||||
<span class="icon"><img src="{{ asset('bundles/foqelastica/images/elastica.png') }}" alt="" /></span>
|
||||
<span class="icon"><img src="{{ asset('bundles/foselastica/images/elastica.png') }}" alt="" /></span>
|
||||
<strong>Elastica</strong>
|
||||
<span class="count">
|
||||
<span>{{ collector.querycount }}</span>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\DataCollector;
|
||||
namespace FOS\ElasticaBundle\Tests\DataCollector;
|
||||
|
||||
use FOQ\ElasticaBundle\DataCollector\ElasticaDataCollector;
|
||||
use FOS\ElasticaBundle\DataCollector\ElasticaDataCollector;
|
||||
|
||||
/**
|
||||
* @author Richard Miller <info@limethinking.co.uk>
|
||||
|
@ -20,7 +20,7 @@ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$loggerMock = $this->getMockBuilder('FOQ\ElasticaBundle\Logger\ElasticaLogger')
|
||||
$loggerMock = $this->getMockBuilder('FOS\ElasticaBundle\Logger\ElasticaLogger')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -45,7 +45,7 @@ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$loggerMock = $this->getMockBuilder('FOQ\ElasticaBundle\Logger\ElasticaLogger')
|
||||
$loggerMock = $this->getMockBuilder('FOS\ElasticaBundle\Logger\ElasticaLogger')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\Doctrine\MongoDB;
|
||||
namespace FOS\ElasticaBundle\Tests\Doctrine\MongoDB;
|
||||
|
||||
use FOQ\ElasticaBundle\Doctrine\MongoDB\Listener;
|
||||
use FOS\ElasticaBundle\Doctrine\MongoDB\Listener;
|
||||
|
||||
class Document{}
|
||||
|
||||
|
@ -20,7 +20,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testObjectInsertedOnPersist()
|
||||
{
|
||||
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
$persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -28,7 +28,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
|
||||
$objectName = 'FOS\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
|
||||
$document = new Document();
|
||||
|
||||
$eventArgsMock->expects($this->once())
|
||||
|
@ -45,7 +45,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testObjectReplacedOnUpdate()
|
||||
{
|
||||
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
$persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -53,7 +53,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
|
||||
$objectName = 'FOS\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
|
||||
$document = new Document();
|
||||
|
||||
$eventArgsMock->expects($this->once())
|
||||
|
@ -70,7 +70,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testObjectDeletedOnRemove()
|
||||
{
|
||||
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
$persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -86,7 +86,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
|
||||
$objectName = 'FOS\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
|
||||
$document = new Document();
|
||||
$documentId = 78;
|
||||
|
||||
|
@ -118,7 +118,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testObjectWithNonStandardIdentifierDeletedOnRemove()
|
||||
{
|
||||
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
$persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -134,7 +134,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
|
||||
$objectName = 'FOS\ElasticaBundle\Tests\Doctrine\MongoDB\Document';
|
||||
$document = new Document();
|
||||
$documentIdentifier = 826;
|
||||
$identifierField = 'identifier';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\Doctrine\ORM;
|
||||
namespace FOS\ElasticaBundle\Tests\Doctrine\ORM;
|
||||
|
||||
use FOQ\ElasticaBundle\Doctrine\ORM\Listener;
|
||||
use FOS\ElasticaBundle\Doctrine\ORM\Listener;
|
||||
|
||||
class Entity{}
|
||||
|
||||
|
@ -20,7 +20,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testObjectInsertedOnPersist()
|
||||
{
|
||||
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
$persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -28,7 +28,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\ORM\Entity';
|
||||
$objectName = 'FOS\ElasticaBundle\Tests\Doctrine\ORM\Entity';
|
||||
$entity = new Entity;
|
||||
|
||||
$eventArgsMock->expects($this->once())
|
||||
|
@ -45,7 +45,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testObjectReplacedOnUpdate()
|
||||
{
|
||||
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
$persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -53,7 +53,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\ORM\Entity';
|
||||
$objectName = 'FOS\ElasticaBundle\Tests\Doctrine\ORM\Entity';
|
||||
$entity = new Entity;
|
||||
|
||||
$eventArgsMock->expects($this->once())
|
||||
|
@ -70,7 +70,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testObjectDeletedOnRemove()
|
||||
{
|
||||
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
$persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -86,7 +86,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\ORM\Entity';
|
||||
$objectName = 'FOS\ElasticaBundle\Tests\Doctrine\ORM\Entity';
|
||||
$entity = new Entity;
|
||||
$entityId = 21;
|
||||
|
||||
|
@ -118,7 +118,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testObjectWithNonStandardIdentifierDeletedOnRemove()
|
||||
{
|
||||
$persisterMock = $this->getMockBuilder('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
$persisterMock = $this->getMockBuilder('FOS\ElasticaBundle\Persister\ObjectPersisterInterface')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -134,7 +134,7 @@ class ListenerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$objectName = 'FOQ\ElasticaBundle\Tests\Doctrine\ORM\Entity';
|
||||
$objectName = 'FOS\ElasticaBundle\Tests\Doctrine\ORM\Entity';
|
||||
$entity = new Entity;
|
||||
$entityIdentifier = 924;
|
||||
$identifierField = 'identifier';
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\IndexManager;
|
||||
namespace FOS\ElasticaBundle\Tests\IndexManager;
|
||||
|
||||
use FOQ\ElasticaBundle\IndexManager;
|
||||
use FOS\ElasticaBundle\IndexManager;
|
||||
|
||||
class IndexManagerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var FOQ\ElasticaBundle\Tests\IndexManager
|
||||
* @var FOS\ElasticaBundle\Tests\IndexManager
|
||||
*/
|
||||
private $indexManager = null;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\Logger;
|
||||
namespace FOS\ElasticaBundle\Tests\Logger;
|
||||
|
||||
use FOQ\ElasticaBundle\Logger\ElasticaLogger;
|
||||
use FOS\ElasticaBundle\Logger\ElasticaLogger;
|
||||
|
||||
/**
|
||||
* @author Richard Miller <info@limethinking.co.uk>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\Manager;
|
||||
namespace FOS\ElasticaBundle\Tests\Manager;
|
||||
|
||||
use FOQ\ElasticaBundle\Manager\RepositoryManager;
|
||||
use FOS\ElasticaBundle\Manager\RepositoryManager;
|
||||
|
||||
class CustomRepository{}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testThatGetRepositoryReturnsDefaultRepository()
|
||||
{
|
||||
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder')
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -24,17 +24,17 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity';
|
||||
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity';
|
||||
|
||||
$manager = new RepositoryManager($readerMock);
|
||||
$manager->addEntity($entityName, $finderMock);
|
||||
$repository = $manager->getRepository($entityName);
|
||||
$this->assertInstanceOf('FOQ\ElasticaBundle\Repository', $repository);
|
||||
$this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository);
|
||||
}
|
||||
|
||||
public function testThatGetRepositoryReturnsCustomRepository()
|
||||
{
|
||||
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder')
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -42,12 +42,12 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity';
|
||||
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity';
|
||||
|
||||
$manager = new RepositoryManager($readerMock);
|
||||
$manager->addEntity($entityName, $finderMock, 'FOQ\ElasticaBundle\Tests\Manager\CustomRepository');
|
||||
$manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\Manager\CustomRepository');
|
||||
$repository = $manager->getRepository($entityName);
|
||||
$this->assertInstanceOf('FOQ\ElasticaBundle\Tests\Manager\CustomRepository', $repository);
|
||||
$this->assertInstanceOf('FOS\ElasticaBundle\Tests\Manager\CustomRepository', $repository);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,7 +55,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testThatGetRepositoryThrowsExceptionIfEntityNotConfigured()
|
||||
{
|
||||
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder')
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -63,7 +63,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity';
|
||||
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity';
|
||||
|
||||
$manager = new RepositoryManager($readerMock);
|
||||
$manager->addEntity($entityName, $finderMock);
|
||||
|
@ -75,7 +75,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testThatGetRepositoryThrowsExceptionIfCustomRepositoryNotFound()
|
||||
{
|
||||
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder')
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
@ -83,10 +83,10 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity';
|
||||
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity';
|
||||
|
||||
$manager = new RepositoryManager($readerMock);
|
||||
$manager->addEntity($entityName, $finderMock, 'FOQ\ElasticaBundle\Tests\MissingRepository');
|
||||
$manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\MissingRepository');
|
||||
$manager->getRepository('Missing Entity');
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\MappingRegistry;
|
||||
namespace FOS\ElasticaBundle\Tests\MappingRegistry;
|
||||
|
||||
use FOQ\ElasticaBundle\MappingRegistry;
|
||||
use FOS\ElasticaBundle\MappingRegistry;
|
||||
use Elastica_Type;
|
||||
use Elastica_Index;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\ObjectPersister;
|
||||
namespace FOS\ElasticaBundle\Tests\ObjectPersister;
|
||||
|
||||
use FOQ\ElasticaBundle\Persister\ObjectPersister;
|
||||
use FOQ\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer;
|
||||
use FOS\ElasticaBundle\Persister\ObjectPersister;
|
||||
use FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer;
|
||||
|
||||
class POPO
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\Populator;
|
||||
namespace FOS\ElasticaBundle\Tests\Populator;
|
||||
|
||||
use FOQ\ElasticaBundle\Populator;
|
||||
use FOQ\ElasticaBundle\Provider\ProviderInterface;
|
||||
use FOS\ElasticaBundle\Populator;
|
||||
use FOS\ElasticaBundle\Provider\ProviderInterface;
|
||||
use Closure;
|
||||
|
||||
class PopulatorMock extends Populator
|
||||
|
@ -15,23 +15,23 @@ class PopulatorTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
public function testThatWeCanAddProvider()
|
||||
{
|
||||
$provider = $this->getMock('FOQ\ElasticaBundle\Provider\ProviderInterface', array('populate'));
|
||||
$provider = $this->getMock('FOS\ElasticaBundle\Provider\ProviderInterface', array('populate'));
|
||||
|
||||
$populator = new PopulatorMock(array());
|
||||
$populator->addProvider('l3l0Provider', $provider);
|
||||
|
||||
$this->assertEquals(count($populator->providers), 1);
|
||||
$this->assertArrayHasKey('l3l0Provider', $populator->providers);
|
||||
$this->assertInstanceOf('FOQ\ElasticaBundle\Provider\ProviderInterface', $populator->providers['l3l0Provider']);
|
||||
$this->assertInstanceOf('FOS\ElasticaBundle\Provider\ProviderInterface', $populator->providers['l3l0Provider']);
|
||||
}
|
||||
|
||||
public function testThatPopulateThroughProviders()
|
||||
{
|
||||
$provider = $this->getMock('FOQ\ElasticaBundle\Provider\ProviderInterface', array('populate'));
|
||||
$provider = $this->getMock('FOS\ElasticaBundle\Provider\ProviderInterface', array('populate'));
|
||||
$provider->expects($this->once())
|
||||
->method('populate');
|
||||
|
||||
$provider2 = $this->getMock('FOQ\ElasticaBundle\Provider\ProviderInterface', array('populate'));
|
||||
$provider2 = $this->getMock('FOS\ElasticaBundle\Provider\ProviderInterface', array('populate'));
|
||||
$provider2->expects($this->once())
|
||||
->method('populate');
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests;
|
||||
namespace FOS\ElasticaBundle\Tests;
|
||||
|
||||
use FOQ\ElasticaBundle\Repository;
|
||||
use FOS\ElasticaBundle\Repository;
|
||||
|
||||
/**
|
||||
* @author Richard Miller <info@limethinking.co.uk>
|
||||
|
@ -14,7 +14,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
$testQuery = 'Test Query';
|
||||
|
||||
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder')
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$finderMock->expects($this->once())
|
||||
|
@ -30,7 +30,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
|
|||
$testQuery = 'Test Query';
|
||||
$testLimit = 20;
|
||||
|
||||
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder')
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$finderMock->expects($this->once())
|
||||
|
@ -45,7 +45,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
|
|||
{
|
||||
$testQuery = 'Test Query';
|
||||
|
||||
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder')
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$finderMock->expects($this->once())
|
||||
|
@ -61,7 +61,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase
|
|||
$testQuery = 'Test Query';
|
||||
$testLimit = 20;
|
||||
|
||||
$finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder')
|
||||
$finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$finderMock->expects($this->once())
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\Reseter;
|
||||
namespace FOS\ElasticaBundle\Tests\Reseter;
|
||||
|
||||
use FOQ\ElasticaBundle\Reseter;
|
||||
use FOQ\ElasticaBundle\IndexManager;
|
||||
use FOS\ElasticaBundle\Reseter;
|
||||
use FOS\ElasticaBundle\IndexManager;
|
||||
use Elastica_Exception_Response;
|
||||
use Elastica_Response;
|
||||
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\Transformer;
|
||||
namespace FOS\ElasticaBundle\Tests\Transformer;
|
||||
|
||||
use FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection;
|
||||
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection;
|
||||
|
||||
class ElasticaToModelTransformerCollectionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var \FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection
|
||||
* @var \FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection
|
||||
*/
|
||||
protected $collection;
|
||||
protected $transformers = array();
|
||||
|
||||
protected function collectionSetup()
|
||||
{
|
||||
$transformer1 = $this->getMock('FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface');
|
||||
$transformer1 = $this->getMock('FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface');
|
||||
$transformer1->expects($this->any())
|
||||
->method('getObjectClass')
|
||||
->will($this->returnValue('FOQ\ElasticaBundle\Tests\Transformer\POPO'));
|
||||
->will($this->returnValue('FOS\ElasticaBundle\Tests\Transformer\POPO'));
|
||||
|
||||
$transformer1->expects($this->any())
|
||||
->method('getIdentifierField')
|
||||
->will($this->returnValue('id'));
|
||||
|
||||
$transformer2 = $this->getMock('FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface');
|
||||
$transformer2 = $this->getMock('FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface');
|
||||
$transformer2->expects($this->any())
|
||||
->method('getObjectClass')
|
||||
->will($this->returnValue('FOQ\ElasticaBundle\Tests\Transformer\POPO2'));
|
||||
->will($this->returnValue('FOS\ElasticaBundle\Tests\Transformer\POPO2'));
|
||||
|
||||
$transformer2->expects($this->any())
|
||||
->method('getIdentifierField')
|
||||
|
@ -44,8 +44,8 @@ class ElasticaToModelTransformerCollectionTest extends \PHPUnit_Framework_TestCa
|
|||
|
||||
$objectClasses = $this->collection->getObjectClass();
|
||||
$this->assertEquals(array(
|
||||
'type1' => 'FOQ\ElasticaBundle\Tests\Transformer\POPO',
|
||||
'type2' => 'FOQ\ElasticaBundle\Tests\Transformer\POPO2'
|
||||
'type1' => 'FOS\ElasticaBundle\Tests\Transformer\POPO',
|
||||
'type2' => 'FOS\ElasticaBundle\Tests\Transformer\POPO2'
|
||||
), $objectClasses);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Tests\Transformer\ModelToElasticaAutoTransformer;
|
||||
namespace FOS\ElasticaBundle\Tests\Transformer\ModelToElasticaAutoTransformer;
|
||||
|
||||
use FOQ\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer;
|
||||
use FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer;
|
||||
|
||||
class POPO
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ if (file_exists($file = __DIR__.'/../vendor/autoload.php')) {
|
|||
}
|
||||
|
||||
spl_autoload_register(function($class) {
|
||||
if (0 === strpos($class, 'FOQ\\ElasticaBundle\\')) {
|
||||
if (0 === strpos($class, 'FOS\\ElasticaBundle\\')) {
|
||||
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
|
||||
if (!stream_resolve_include_path($path)) {
|
||||
return false;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Transformer;
|
||||
namespace FOS\ElasticaBundle\Transformer;
|
||||
|
||||
use FOQ\ElasticaBundle\HybridResult;
|
||||
use FOS\ElasticaBundle\HybridResult;
|
||||
|
||||
/**
|
||||
* Holds a collection of transformers for an index wide transformation.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Transformer;
|
||||
namespace FOS\ElasticaBundle\Transformer;
|
||||
|
||||
/**
|
||||
* Maps Elastica documents with model objects
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Transformer;
|
||||
namespace FOS\ElasticaBundle\Transformer;
|
||||
|
||||
/**
|
||||
* Maps Elastica documents with model objects
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Transformer;
|
||||
namespace FOS\ElasticaBundle\Transformer;
|
||||
|
||||
use Elastica_Document;
|
||||
use Traversable;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace FOQ\ElasticaBundle\Transformer;
|
||||
namespace FOS\ElasticaBundle\Transformer;
|
||||
|
||||
/**
|
||||
* Maps Elastica documents with model objects
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name": "exercise/elastica-bundle",
|
||||
"name": "friendsofsymfony/elastica-bundle",
|
||||
"type": "symfony-bundle",
|
||||
"description": "Elasticsearch PHP integration for your Symfony2 project using Elastica",
|
||||
"keywords": ["doctrine2", "elastica", "elasticsearch", "mongodb", "propel", "search"],
|
||||
"homepage": "https://github.com/Exercise/FOQElasticaBundle",
|
||||
"homepage": "https://github.com/FriendsOfSymfony/FOSElasticaBundle",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{ "name": "Thibault Duplessis", "email": "thibault.duplessis@gmail.com" },
|
||||
|
@ -27,7 +27,7 @@
|
|||
"propel/propel1": "1.6.*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "FOQ\\ElasticaBundle": "" }
|
||||
"psr-0": { "FOS\\ElasticaBundle": "" }
|
||||
},
|
||||
"target-dir": "FOQ/ElasticaBundle"
|
||||
"target-dir": "FOS/ElasticaBundle"
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<phpunit bootstrap="./Tests/bootstrap.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="FOQElasticaBundle Test Suite">
|
||||
<testsuite name="FOSElasticaBundle Test Suite">
|
||||
<directory>./Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
|
Loading…
Reference in a new issue