Set publishState

@param integer $publishState
@return Publish
497465
public function setPublishState($publishState)
    {
        $this->publishState = $publishState;

        if ($publishState === self::PUBLISH && is_null($this->publishDate)) {
            $this->setPublishDate(new \DateTime());
        }

        return $this;
    }
1095680
public function setStatus($status)
    {
        if($entity = $this->getIterator()->current()) {
            $entity->setStatusMessage($status);
        }

        return $this;
    }
1049336
public function setStatus($status)
    {
        if (!in_array($status, static::getAvailableStatuses(), true)) {
            throw new InvalidArgumentException(sprintf('Status not recognized ; Had "%s", expected one of "%s"', $status, implode('", "', static::getAvailableStatuses())));
        }

        $this->status = $status;

        return $this;
    }
778266
public function setWorkflowStageToPublished(PublishEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($event)) {
            return;
        }

        $this->setWorkflowStage($document, $event->getAccessor(), WorkflowStage::PUBLISHED, $event->getLocale(), true);
    }
1058777
public function setDatePublishStart($datePublishStart = null)
    {
        if (!isset($datePublishStart) || is_string($datePublishStart)) {
            $datePublishStart = new \DateTime($datePublishStart);
        } elseif (!$datePublishStart instanceof \DateTime) {
            throw new \InvalidArgumentException('Expected object of type \DateTime');
        }

        $this->datePublishStart = $datePublishStart;
        return $this;
    }
1254865
public function storeAuthorizationState($service, $state)
    {
        $service = $this->normalizeServiceName($service);

        $states = $this->sessionScope->get(self::SESSION_STATE);
        $states[$service] = $state;
        $this->sessionScope->set(self::SESSION_STATE, $states);

        return $this;
    }
1029867
public function setSelected( $state ) {
		$this->selected = (bool)$state;
		if ( $this->selected ) {
			$this->input->setAttributes( [ 'checked' => 'checked' ] );
		} else {
			$this->input->removeAttributes( [ 'checked' ] );
		}
		return $this;
	}
926529
public function setState($state)
    {
        $state = (int) $state;
        if ($this->isRoot() && !($state & Page::STATE_ONLINE)) {
            throw new \LogicException("Root page state must be online.");
        }

        if (!$this->isOnline() && (self::STATE_ONLINE & $state) && !$this->isRoot() && !$this->getPublishing()) {
            $this->setPublishing(new \DateTime());
        }

        $this->_state = $state;

        return $this;
    }
741735
public function setPublishDate($dateFormat = 'F d, Y')
	{
		$name_separate = explode('-', $this->getFileName(), 4);
		$originalDate = $name_separate[0] . '-' . $name_separate[1] . '-' .$name_separate[2];
		$this->publishDate = date($dateFormat, strtotime($originalDate));
	}
910709
public function publish()
    {
        if ($this->_block->getPageId() && $this->_isSaved) {
            $searchText = $this->_block->search_weight > 0 ? $this->generateSearchText($this->_contentSaved) : '';
            $this->_block->publishContent($searchText);
        }
        return $this;
    }
644021
public T withPagingState(PagingState pagingState) {
        getOptions().setPagingState(Optional.of(pagingState));
        return getThis();
    }
469151
public function setOverwrite($state = false)
	{
		$tmp = $this->overwrite;

		if ($state)
		{
			$this->overwrite = true;
		}
		else
		{
			$this->overwrite = false;
		}

		return $tmp;
	}
1176922
public function setStatus($status)
    {
        $allowed_values = array('active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted');
        if ((!in_array($status, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'active', 'paused', 'ready', 'delivered', 'cancelled', 'reverted'");
        }
        $this->container['status'] = $status;

        return $this;
    }
536565
public function setSummaryHashState(string $hashState): self
    {
        $len = Util::strlen($hashState);
        if ($len !== 384 && $len !== 361) {
            throw new \RangeException(
                'Expected exactly 361 or 384 bytes, ' . $len . ' given.'
            );
        }
        $this->summaryHashState = $hashState;
        return $this;
    }
1043243
public function switchPublicationState(Post $post)
    {
        if (!$post->isPublished()) {
            $post->publish();
        } else {
            $post->unpublish();
        }

        $this->om->flush();

        $unitOfWork = $this->om->getUnitOfWork();
        $unitOfWork->computeChangeSets();
        $changeSet = $unitOfWork->getEntityChangeSet($post);

        $this->trackingManager->dispatchPostUpdateEvent($post, $changeSet);

        return $post;
    }
855390
public function setState(array $state): ORM
    {
        if (isset($state[$this->getPrimaryKey()])) {
            $this->state = $state;
        }

        $this->attributes = $state;

        return $this;
    }
892439
public function setPublishLanguages($publishLanguages)
    {
        $fileVersion = $this->getFileVersion();

        foreach ($publishLanguages as $locale) {
            $publishLanguage = new FileVersionPublishLanguage();
            $publishLanguage->setFileVersion($fileVersion);
            $publishLanguage->setLocale($locale);
            if (!$fileVersion->getPublishLanguages()->contains($publishLanguage)) {
                $fileVersion->addPublishLanguage($publishLanguage);
            }
        }

        return $this;
    }