public function DefaultMediaHandler::push in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/Plugin/cms_content_sync/entity_handler/DefaultMediaHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultMediaHandler::push()
- 2.0.x src/Plugin/cms_content_sync/entity_handler/DefaultMediaHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultMediaHandler::push()
Parameters
\Drupal\cms_content_sync\PushIntent $intent: The request to store all relevant info at
Return value
bool Whether or not the content has been pushed. FALSE is a desired state, meaning nothing should be pushed according to config.
Throws
\Drupal\cms_content_sync\Exception\SyncException
Overrides EntityHandlerBase::push
File
- src/
Plugin/ cms_content_sync/ entity_handler/ DefaultMediaHandler.php, line 36
Class
- DefaultMediaHandler
- Class DefaultMediaHandler, providing a minimalistic implementation for the media entity type.
Namespace
Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handlerCode
public function push(PushIntent $intent, EntityInterface $entity = null) {
if (!parent::push($intent, $entity)) {
return false;
}
if (!$entity) {
$entity = $intent
->getEntity();
}
/**
* @var \Drupal\node\NodeInterface $entity
*/
$intent
->setProperty('created', intval($entity
->getCreatedTime()));
return true;
}