Last active
December 13, 2016 14:25
-
-
Save janit/e19bcf579a7535562c3c19e39f647028 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$stateId = 3; | |
$stateService = $this->get('ezpublish.api.service.object_state'); | |
$contentService = $this->get('ezpublish.api.service.content'); | |
$contentInfo = $contentService->loadContentInfo(93); | |
$objectStateGroup = $stateService->loadObjectStateGroup(4); | |
$currentState = $stateService->getContentState($contentInfo,$objectStateGroup); | |
if($currentState->id == 3) { | |
$stateId = 4; | |
} | |
$objectState = $stateService->loadObjectState($stateId); | |
$stateService->setContentState($contentInfo,$objectStateGroup,$objectState); | |
dump($currentState); | |
die(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment