honeybee / trellis

Library for defining structured entities in php.
Mozilla Public License 2.0
8 stars 1 forks source link

Support for min/max_count option override for DataGenerator #6

Open graste opened 9 years ago

graste commented 9 years ago

Would be nice if one can specify via options whether an embedded entity is always created or not. At the moment it's a random number of entries for an EmbeddedEntityListAttribute between min_count and max_count attribute option value with a default of 0 for min_count. At least the minimum number of embedded entities to create in fake data would be nice.

MrHash commented 9 years ago

Given that the min_count and inline_mode is supported wouldn't it make sense to use those options? or the mandatory option? Empty entity lists are valid so better to generate more data if you want to ensure data is present?

graste commented 9 years ago

Actually depends on use case. I had one where I wanted entities with as many embedded entities as possible for each embedded type if I could've configured that. So I set the max count to the number of embedded entities I needed and then generated multiple root entities to have a chance of getting the different embedded types for my export test data that I needed to be full for tests.

MrHash commented 9 years ago

If you wanted to override, how would you specify the number of embedded types to render? And would this apply to all root entities when generating several at the same time?