How can I generate sequential data?

223 Views Asked by At

I am currently trying to figure out how to generate data with Nelmio Alice and Faker. Here is the model I need to fill:

person and insurance policy class diagram

Let's say we need to match persons and their insurance policies. One person can have only one active insurance policy at a given time. Each insurance policy belongs to a single person.

This means that all the insurance policies of one person must not overlap. So when generating the insurance policy entities I need some way to tell Alice to generate begin and end in such a way that the new object does not conflict with the already existing objects.

How would I go about doing that? From looking at the Alice documentation, I have only found that it is possible to make attributes of an object depend on other attributes of the same object, but not how to make them depend on attributes of objects that are already there.

0

There are 0 best solutions below