WebflowApiCollections.php 534 B

1234567891011121314151617181920
  1. <?php
  2. namespace App\Http\WebflowApi;
  3. class WebflowApiCollections extends AbstractWebflowApiCollection implements \IteratorAggregate{
  4. protected function getLoadScope(): string {
  5. return sprintf('/sites/%s/collections', $this->parent->data['_id']);
  6. }
  7. public function createEntry($key, $value): ?AbstractWebflowApiField {
  8. return new WebflowApiCollection($this->getClient(), $value);
  9. }
  10. public function getIterator(): \Traversable
  11. {
  12. return new \ArrayIterator($this->getData());
  13. }
  14. }