private function limitField(Field $field, array $allowed_collections = null) { if ($allowed_collections === null) { $allowed_collections = $this->allowedCollections(); } $collections = array_values(array_intersect($field->getDependantCollections(), $allowed_collections)); return $field->withOptions(['used_by_collections' => $collections]); }