Publishes $toType to $newStatus.

@param \eZ\Publish\SPI\Persistence\Content\Type $toType
@param int $newStatus
434414
public function publishNewType(Type $toType, $newStatus)
    {
        $this->contentTypeGateway->publishTypeAndFields(
            $toType->id,
            $toType->status,
            $newStatus
        );
    }
826479
public function markAsRead($type = 'notifications')
    {
        DB::beginTransaction();
        try {
            $builder = ($type === 'alerts') ? $this->getAlerts() : $this->getNotifications();
            $read    = NotificationsStackRead::select(['stack_id'])->withTrashed()->where('user_id', user()->id)->pluck('stack_id');
            $items   = $builder->whereNotIn('id', $read)->get();

            foreach ($items as $item) {
                $item->read()->save(new NotificationsStackRead([
                    'user_id' => user()->id
                ]));
                $item->save();
            }
        } catch (Exception $ex) {
            DB::rollback();
            return false;
        }
        return DB::commit();
    }
826669
public function message($to, $body, $type = 'chat', $subject = null, $payload = null)
    {
        if ($type === null) {
            $type = 'chat';
        }

        $to = htmlspecialchars($to);
        $body = htmlspecialchars($body);
        $subject = htmlspecialchars($subject);

        $out = '<message from="' . $this->fulljid . '" to="' . $to . '" type="' . $type . '">';
        if ($subject) {
            $out .= '<subject>' . $subject . '</subject>';
        }
        $out .= '<body>' . $body . '</body>';
        if ($payload) {
            $out .= $payload;
        }
        $out .= "</message>";

        $this->sendXML($out);
    }
682139
protected function publishDirectory($from, $to)
    {
        $this->copyDirectory($from, $to);

        $this->status($from, $to, 'Directory');
    }
90316
public function determineActions(Type $fromType, Type $toType)
    {
        $actions = array();
        foreach ($fromType->fieldDefinitions as $fieldDef) {
            if (!$this->hasFieldDefinition($toType, $fieldDef)) {
                $actions[] = new ContentUpdater\Action\RemoveField(
                    $this->contentGateway,
                    $fieldDef,
                    $this->storageHandler,
                    $this->contentMapper
                );
            }
        }
        foreach ($toType->fieldDefinitions as $fieldDef) {
            if (!$this->hasFieldDefinition($fromType, $fieldDef)) {
                $actions[] = new ContentUpdater\Action\AddField(
                    $this->contentGateway,
                    $fieldDef,
                    $this->converterRegistry->getConverter(
                        $fieldDef->fieldType
                    ),
                    $this->storageHandler,
                    $this->contentMapper
                );
            }
        }

        return $actions;
    }
703109
protected function publishSection() {
		$parent = DataObject::get_by_id('NewsHolder', $this->ParentID);
		while ($parent && $parent instanceof NewsHolder) {
			if (!$parent->isPublished()) {
				$parent->doPublish();
			}
			$parent = $parent->Parent();
		}
	}
76499
public function publishType($type)
    {
        $publish = true;

        if ($type instanceof Type and $type->getName() !== 'home' and $type->getName() !== 'menu') {
            if ($type->isPublish()) {
                $publish = false;
            }

            $type->setPublish($publish);
            $this->manager->persist($type);
            $this->manager->flush();
        }

        return $publish;
    }
615455
public function errorLog($type = 'debug', $messageType = ErrorLogHandler::OPERATING_SYSTEM)
    {
        $this->pushHandler(new ErrorLogHandler($messageType, $this->getLevel($type)));
    }
205999
public function notify($type = 'default')
    {
        if (isset($this->observers[$type])) {
            foreach ($this->observers[$type] as $obs) {
                $obs->update($this);
            }
        }
        return $this;
    }
1201348
public static function update($ids, $status, $type, &$context) {
    // Setup.
    if (empty($context['sandbox'])) {
      $context['sandbox']['progress'] = 0;
      $context['sandbox']['max'] = count($ids);
      $context['results']['status'] = $status;
      $context['results']['type'] = $type;
    }
    $items_per_iteration = 50;

    $batch_ids = array_slice($ids, $context['sandbox']['progress'], $items_per_iteration);
    $nodes = \Drupal::entityTypeManager()->getStorage('node')->loadMultiple($batch_ids);

    foreach ($nodes as $node) {
      if ($status && !$node->isPublished()) {
        // Publish all Activity nodes.
        $node->setPublished();
        $node->save();
      } elseif (!$status && $node->isPublished()) {
        // Unpublish all Category nodes.
        $node->setUnPublished();
        $node->save();
      }
      $context['sandbox']['progress']++;
      $context['results']['ids'][] = $node->id();
    }

    $first_node = reset($nodes);
    $context['message'] = t('Now processing %node', ['%node' => $first_node->title]);
    // When result is 1, the batch will finish.
    $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
  }
658335
@Override
  public <T> ServiceBuilderAmp newService(Class<T> type)
  {
    Objects.requireNonNull(type);
    
    return new ServiceBuilderImpl<>(this, type);
  }
164077
private void publishEvent(WSJobExecution objectToPublish, String eventToPublishTo, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobExecutionEvent(objectToPublish, eventToPublishTo, correlationId);
        }
    }
482742
public function message($to, $body, $type = 'chat', $subject = null, $payload = null) {
	    if(is_null($type))
	    {
	        $type = 'chat';
	    }
	    
		$to	  = htmlspecialchars($to);
		$body	= htmlspecialchars($body);
		$subject = htmlspecialchars($subject);
		
		$out = "<message from=\"{$this->fulljid}\" to=\"$to\" type='$type'>";
		if($subject) $out .= "<subject>$subject</subject>";
		$out .= "<body>$body</body>";
		if($payload) $out .= $payload;
		$out .= "</message>";
		
		$this->send($out);
	}
1042404
protected function transistionRecordStatus(Content $entity, $newStatus)
    {
        $contentTypeName = (string) $entity->getContenttype();
        $canTransition = $this->users->isContentStatusTransitionAllowed($entity->getStatus(), $newStatus, $contentTypeName, $entity->getId());
        if (!$canTransition) {
            $this->loggerFlash->error(Trans::__('general.access-denied.content-not-modified', ['%title%' => $entity->getTitle()]));

            return;
        }
        $entity->setStatus($newStatus);
        $entity->_modified = true;
    }
1044185
public function report($type, $data)
    {
        if (!$reporters = $this->reporters()) {
            return;
        }
        $reporters->dispatch($type, $data);
    }
352888
public function setContentType($type, $statusCode=null)
    {
        if (isset(static::$_types[$type])) {
            $type = static::$_types[$type];
        }
        $this->setHeader('Content-Type', $type);
        if ($statusCode) {
            $this->_statusCode = $statusCode;
        }
    }
897862
protected function isValidNotificationType(string $notificationType): void
    {
        $allowedNotificationType = $this->getAllowedNotificationType();
        if (!\in_array($notificationType, $allowedNotificationType, true)) {
            throw new InvalidTypeException(sprintf(
                'notificationType must be either "%s".',
                implode(', ', $allowedNotificationType)
            ));
        }
    }