Writes the cache of relation links.
protected function writeCache() {
$data = array();
foreach (field_info_fields() as $field_info) {
foreach ($field_info['bundles'] as $entity_type => $bundles) {
foreach ($bundles as $bundle) {
$relation_uri = $this
->getRelationUri($entity_type, $bundle, $field_info['field_name']);
$data[$relation_uri] = array(
'entity_type' => $entity_type,
'bundle' => $bundle,
'field_name' => $field_info['field_name'],
);
}
}
}
// These URIs only change when field info changes, so cache it permanently
// and only clear it when field_info is cleared.
$this->cache
->set('rest:links:relations', $data, CacheBackendInterface::CACHE_PERMANENT, array(
'field_info' => TRUE,
));
}