-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Description
Ahoj,
ako spravne managovat kolekcie v LM ?
/**
* @property int $id
* @property Bar[] $bars m:belongsToMany
*/
class Foo extends Entity
{
}
/**
* @property int $id
*/
class Bar extends Entity
{
}
ked upravujem kolekciu:
$foo = $this->fooRepository->find($id);
$this->barRepository->deleteById($barId);
$bars = $foo->getBars();
na poslednom riadku to hodi vinimku:
Cannot get value of property 'bars' in entity Foo due to low-level failure: It is not allowed to create entity Bar from detached instance of LeanMapper\Row
priblizne chapem co sa tam deje, len by ma zaujimalo ako sa tomu vyhnut a ako riesit taketo situacie