You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.
When I try to relate two entities, faker is not executed correctly and that generates a InvalidArgumentException:
[InvalidArgumentException]
randomNumber() can only generate numbers up to mt_getrandmax()
As a result it does not generate the data in the related table let alone the FK. Clarify that I'm not using the method randomNumber() anywhere in my code. I'm working with CakePHP 3.1.7
Please appreciate it if you could check that detail.
Thank you very much for all your great work!
The text was updated successfully, but these errors were encountered:
If you're using Phinx> 0.5.0 you can now use that for your database seeding, which is part of cakephp/migrations.
Using Faker, I used the $faker->numberBetween(1, 4), for some fields, which might give you more reliable results. Although it sounds like you're generating a pretty large dataset.
When it comes to the entity generation, you'll want to generate your entities in a loop calling the faker methods to populate the entity properties. You should be able to generate the entities as properties of the entity ($entity->tags is an array of Tag entities) and save it all in one go for things which are directly related.
When I try to relate two entities, faker is not executed correctly and that generates a InvalidArgumentException:
[InvalidArgumentException]
randomNumber() can only generate numbers up to mt_getrandmax()
As a result it does not generate the data in the related table let alone the FK. Clarify that I'm not using the method randomNumber() anywhere in my code. I'm working with CakePHP 3.1.7
Please appreciate it if you could check that detail.
Thank you very much for all your great work!
The text was updated successfully, but these errors were encountered: