[Flow] Strange Exception when migrating DB
Christian Loock
chl at vkf-renzel.de
Tue Aug 27 15:19:12 CEST 2013
All right,
I figured out, that I have to switch it arround, with the OneToMany /
ManyToOne.
This works now without the exception.
However, when I add a User to the users collection of the customer
object, it won't get persisted...
Am 27.08.2013 15:08, schrieb Christian Loock:
> Okay, it is back!
>
> What i did: I changed a relation from being ManyToMany to be ManyToOne
> / OneToMany.
>
> Here the properties of both models:
>
> Class \VKF\Admin\Domain\Model\User
>
> /**
> *
> * @ORM\OneToMany(mappedBy="users")
> * @var \VKF\Admin\Domain\Model\Customer
> */
> protected $customer;
>
>
> Class \VKF\Admin\Domain\Model\Customer
> /**
> * @ORM\ManyToOne(inversedBy="customer")
> * @var
> \Doctrine\Common\Collections\Collection<\VKF\Admin\Domain\Model\User>
> */
> protected $users;
>
>
> Here is the complete exception:
>
> *No class schema found for "Doctrine\Common\Collections\Collection".
> The class should probably marked as entity or value object! This
> happened while examining "VKF\Admin\Domain\Model\Customer" More
> Information Exception code #1340185197*
>
> I hope I didnt get anything wron with those relations.
>
> One customer can have many Users, and One User only has one customer.
> If I understood the doctrine documentation correctly, this is how it
> should be done, right?
>
> Greetings,
>
> Christian
>
>
> Am 27.08.2013 14:38, schrieb Christian Loock:
>> Hi Mathis,
>>
>> must have been something like this. Or maybe an old version of the
>> model was cached or somethin likes this. Fortunatly, all of a sudden
>> it worked.
>>
>> Strange.
>>
>>
>>
>> Am 27.08.2013 14:28, schrieb Mathis Hoffmann:
>>> Hello Christian,
>>>
>>> I guess the following: You have an an entity with a OneToMany
>>> association to another entity. You store the associated entities in
>>> a Doctrine\Common\Collections\Collection, right? How does the
>>> @var-annotation look like for this variable? It should be something
>>> like @var
>>> \Doctrine\Common\Collections\Collection<\Your\Target\Entity>. Maybe
>>> you forgot the leading backslash before Doctrine or you forgot to
>>> specify the target entity?
>>>
>>> Hope that helps!
>>>
>>> Cheers
>>> Mathis
>>>
>>> Am 27.08.2013 14:00, schrieb Christian Loock:
>>>> Hi,
>>>>
>>>> when I run doctrine:create i get the following exception:
>>>>
>>>> No class schema found for
>>>> "Doctrine\Common\Collections\Collection". The
>>>> class should probably marked as entity or value object!
>>>>
>>>> What exactly is a class schema.
>>>>
>>>> Can anybody hint me into a direction to investigate this?
>>>>
>>>> The error itself does not really help at all.
>>>>
>>>> Greetings,
>>>>
>>>> Christian
>>>> _______________________________________________
>>>> Flow mailing list
>>>> Flow at lists.typo3.org
>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>>>
>>>
>>>
>>> Am 27.08.2013 14:00, schrieb Christian Loock:
>>>> Hi,
>>>>
>>>> when I run doctrine:create i get the following exception:
>>>>
>>>> No class schema found for
>>>> "Doctrine\Common\Collections\Collection". The
>>>> class should probably marked as entity or value object!
>>>>
>>>> What exactly is a class schema.
>>>>
>>>> Can anybody hint me into a direction to investigate this?
>>>>
>>>> The error itself does not really help at all.
>>>>
>>>> Greetings,
>>>>
>>>> Christian
>>>> _______________________________________________
>>>> Flow mailing list
>>>> Flow at lists.typo3.org
>>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>>>
>>>
>>>
>>> _______________________________________________
>>> Flow mailing list
>>> Flow at lists.typo3.org
>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>>
>> _______________________________________________
>> Flow mailing list
>> Flow at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list