Ublaboo\Datagrid + doctrine + translatable + filtrování

exquis
Člen | 82
+
0
-

Ahoj,

používám ublaboo\datagrid, k tomu dále doctrine a překlady od:

use Knp\DoctrineBehaviors\Model\Translatable\Translatable;
use Zenify\DoctrineBehaviors\Entities\Attributes\Translatable as ZenifyTranslatable;

resp.

use Knp\DoctrineBehaviors\Model\Translatable\Translation;

Narážím však na problém během fitrování, kde zkouším filtrování dle parametrů přímo hlavní entity je v pořádku, ale jakmile chci filtrovat např. dle jména, ktereé je uvedené v překladové entitě, tak je problém a vyhazuje:

call_user_func_array() expects parameter 1 to be a valid callback, class 'App\Model\Entity\Product\ProductTranslation' does not have a method 'getP'

Grid vytvářím:

$grid = $this->datagridFactory->create();
		$grid->setDataSource($this->productRepository->createQueryBuilder('p'));
		$grid->setRememberState(FALSE);
		$grid->setTranslatorPrefixed('adminProductGridControl.grid');

		$grid->addColumnText('id', 'column.id')
			->setSortable()
			->getElementPrototype('th')
			->setAttribute('width', '100px');

		$grid->addColumnBoolean('isActive');

		$grid->addColumnBoolean('isSalable');

		$grid->addColumnLink('name', 'column.name', ':Product:Admin:Product:edit', 'p.translations.name')
			->setSortable();

		$grid->addColumnText('premierId', 'column.premierId');

		$grid->addColumnText('ean', 'column.ean', 'p.productSkus.ean');

		$grid->getColumn('id')->setFilterText();
		$grid->getColumn('name')->setFilterText();
		$grid->getColumn('premierId')->setFilterText();
		$grid->getColumn('ean')->setFilterText();

		$grid->addAction('edit', 'action.edit', ':Product:Admin:Product:edit')
			->setClass('btn btn-info btn-xs');

		$grid->addAction('delete', 'action.delete', 'delete!')
			->setClass('btn btn-danger btn-xs');

		return $grid;

napadá někoho co s tím? používám to případně špatně? Případně když jako COLUMN nebudu dávat ‚p.translations.name‘, ale vynechám to ‚p.‘ na začátku, tedy ‚translations.name‘ tak vyhazuje chybu:

Neither the property „name“ nor one of the methods „getName()“, „name()“, „isName()“, „hasName()“, „__get()“ exist and have public access in class „Doctrine\ORM\PersistentCollection“.