for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace GBProd\ElasticsearchDataProviderBundle\DataProvider;
/**
* Entry for dataprovider registry
*
* @author gbprod <[email protected]>
*/
class RegistryEntry
{
* @var DataProvider
private $provider;
* @var string
private $index;
private $type;
* @param DataProvider $provider
* @param string $index
* @param string $type
public function __construct(DataProvider $provider, $index, $type)
$this->provider = $provider;
$this->index = $index;
$this->type = $type;
}
* Get provider
* @return DataProvider
public function getProvider()
return $this->provider;
* Get index
* @return string
public function getIndex()
return $this->index;
* Get type
public function getType()
return $this->type;
public function match($index, $type)
return ($this->getIndex() == $index && $this->getType() == $type)
|| ($this->getIndex() == $index && $type === null)
|| (null === $index && $type === null)
;