/** * Get the fields used by the channels in the specified collection * @param \rsanchez\Deep\Collection\ChannelCollection $channels * @return \rsanchez\Deep\Collection\FieldCollection */ public function getFieldsByChannelCollection(ChannelCollection $channels) { $this->boot(); $fields = new FieldCollection(); foreach ($channels as $channel) { foreach ($channel->fields as $field) { $fields->push($field); } } return $fields; }