public function ContentHubFilter::updateValues in Acquia Content Hub 8
Update values of the original entity to the one submitted by REST.
Parameters
\Drupal\acquia_contenthub_subscriber\ContentHubFilterInterface $contenthub_filter_original: The original content hub filter.
Return value
\Drupal\acquia_contenthub_subscriber\ContentHubFilterInterface The updated content hub filter.
File
- acquia_contenthub_subscriber/
src/ Entity/ ContentHubFilter.php, line 289
Class
- ContentHubFilter
- Defines the ContentHubFilter entity.
Namespace
Drupal\acquia_contenthub_subscriber\EntityCode
public function updateValues(ContentHubFilterInterface $contenthub_filter_original) {
// The following are the only fields that we allow to change through PATCH.
$replaceable_fields = [
'name',
'publish_setting',
'search_term',
'from_date',
'to_date',
'source',
'entity_types',
'bundles',
'tags',
];
foreach ($this->_restSubmittedFields as $field) {
if (in_array($field, $replaceable_fields)) {
$contenthub_filter_original->{$field} = $this->{$field};
}
}
return $contenthub_filter_original;
}