function _cms_content_sync_override_embedded_entity_submit in CMS Content Sync 2.0.x
Same name and namespace in other branches
- 8 cms_content_sync.module \_cms_content_sync_override_embedded_entity_submit()
- 2.1.x cms_content_sync.module \_cms_content_sync_override_embedded_entity_submit()
Entity status update.
Update the EntityStatus for the given entity, setting the EntityStatus::FLAG_EDIT_OVERRIDE flag accordingly.
Parameters
array $form:
\Drupal\Core\Form\FormStateInterface $form_state:
1 string reference to '_cms_content_sync_override_embedded_entity_submit'
- _cms_content_sync_add_embedded_entity_submit_handler in ./
cms_content_sync.module - Add a submit handler to the form in case paragraphs are embedded within it.
File
- ./
cms_content_sync.module, line 1707 - Module file for cms_content_sync.
Code
function _cms_content_sync_override_embedded_entity_submit(array $form, FormStateInterface $form_state) {
$value = boolval($form_state
->getValue('cms_content_sync_edit_override'));
/**
* @var \Drupal\Core\Entity\EntityInterface $entity
*/
$entity = $form_state
->getFormObject()
->getEntity();
if ($entity instanceof FieldableEntityInterface) {
_cms_content_sync_override_embedded_entity_save_status_entity($entity, $form, $form_state, [], !$value);
}
}