use Enlight_Controller_Request_Request
as Request;
use Shopware\Bundle\AttributeBundle\Repository\RegistryInterface;
use Shopware\Bundle\AttributeBundle\Repository\SearchCriteria;
class Shopware_Controllers_Backend_EntitySearch extends Shopware_Controllers_Backend_ExtJs
{ public function searchAction() { try { $criteria =
$this->
createCriteria($this->
Request());
/** @var RegistryInterface $registry */
$registry =
$this->
get('shopware_attribute.repository_registry'
);
$repository =
$registry->
getRepository($criteria);
$result =
$repository->
search($criteria);
$this->
View()->
assign([ 'success' => true,
'data' =>
array_values($result->
getData()),
'total' =>
$result->
getCount(),
]);