Closed kreierson closed 4 years ago
I guess my issue is I can get an array/collection of periods, but I am lacking knowledge on how to get these periods into the comma separated form to pass into the period collection properly. There might be some cool trick I am unaware of to accomplish this.
The trouble is, I don't know the exact number of periods that will be passed into the Period Collection. In my example, I might have a calendar of events stored in a database, so if I want to check the overlap for a certain date range against existing events, it's easy to get a collection of events and create a collection of periods. But the Period Collection does not accept a collection/array.
You should use the spread operator:
new PeriodCollection(...$event_periods);
I think it would be really nice if we could pass an array or collection of periods into a Period Collection.
Rather than having to do
We could do something like this:
Let me know if that doesn't make sense.