Publishes content objects.

@param TreeObject $object

@throws \InvalidArgumentException
544893
private function publishContentObjects(TreeObject $object)
    {
        $last = $this->objectService->createOrUpdate($object->data);

        foreach ($object->getNodes() as $subObject) {
            if ($subObject instanceof TreeObject) {
                $this->publishContentObjects($subObject);
            } else {
                /* @var ContentObject $subObject */
                $subObject->addParentLocation($last->getProperty('content_info')->mainLocationId);
                $this->objectService->createOrUpdate($subObject);
            }
        }
    }
830022
public static function reset($object)
	{
		if (!($object instanceof NamePart)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\UninterpretedOption\NamePart.');
		}
		$object->namePart = NULL;
		$object->isExtension = NULL;
	}
1320972
public static function render($object, string $context = null): void
    {
        self::$renderer->render($object, $context);
    }
1304261
public function remove($object)
    {
        $this->assetService->validateRemoval($object);
        parent::remove($object);
        $this->assetService->emitAssetRemoved($object);
    }
192283
public function canHandle($object)
    {
        if (parent::canHandle($object) &&
            ($object instanceof Media && $object->getContentType() == 'application/pdf')
        ) {
            return true;
        }

        return false;
    }
632612
protected function checkPermissions(TreeInterface $object)
    {
        if (!$this->permissionsIgnored) {
            $home = $object->getSiteTreeObject()->getSiteHomePageObject();
            if ($home) {
                $cp = new Checker($home);

                return $cp->canViewPageInSitemap();
            }
        }

        return true;
    }
1223350
public function preUpdate(LifecycleEventArgs $args): void
    {
        // Get the object and make sure it is what we need.
        $object = $args->getObject();
        if (!$object instanceof PublishableInterface) {
            return;
        }

        // Active unpublished objects should be published.
        if ($object->isActive() && !$object->isPublished()) {
            $object->setPublished(true);
        }
    }
1304742
public static function reset($object)
	{
		if (!($object instanceof Location)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\SourceCodeInfo\Location.');
		}
		$object->path = NULL;
		$object->span = NULL;
		$object->leadingComments = NULL;
		$object->trailingComments = NULL;
		$object->leadingDetachedComments = NULL;
	}
569832
public function publishObject(DataObject $object)
    {
        // Detect Versioned Extension:
        
        if ($object->hasExtension(Versioned::class)) {
            
            // Copy Draft to Live:
            
            $object->copyVersionToStage(
                Versioned::DRAFT,
                Versioned::LIVE
            );
            
            // Clear Cache:
            
            $object->flushCache();
            
        }
        
        // Answer Object:
        
        return $object;
    }
713505
function publishObject( &$result, &$errors, &$notices,
                            $object, $publishVersion, $class, $parentNodes, $parentMainNode )
    {
        $operationResult = eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $object->attribute( 'id' ),
                                                                                     'version' => $publishVersion ) );

        $objectID = $object->attribute( 'id' );
        unset( $object );
        $object = eZContentObject::fetch( $objectID );
        $result['contentobject'] = $object;
        $result['contentobject_id'] = $object->attribute( 'id' );
        $result['contentobject_version'] = $publishVersion;
        $result['contentobject_main_node'] = false;
        $result['contentobject_main_node_id'] = false;

        $this->setResult( array( 'node_id' => false,
                                 'object_id' => $object->attribute( 'id' ),
                                 'object_version' => $publishVersion ) );

        switch ( $operationResult['status'] )
        {
            case eZModuleOperationInfo::STATUS_HALTED:
            {
                if ( isset( $operationResult['redirect_url'] ) )
                {
                    $result['redirect_url'] = $operationResult['redirect_url'];
                    $notices[] = array( 'description' => ezpI18n::tr( 'kernel/content/upload',
                                                                 'Publishing of content object was halted.' ) );
                    return true;
                }
                else if ( isset( $operationResult['result'] ) )
                {
                    $result['result'] = $operationResult['result'];
                    return true;
                }
            } break;

            case eZModuleOperationInfo::STATUS_CANCELLED:
            {
                $result['result'] = ezpI18n::tr( 'kernel/content/upload',
                                            'Publish process was cancelled.' );
                return true;
            } break;

            case eZModuleOperationInfo::STATUS_CONTINUE:
            {
            }
        }

        $mainNode = $object->mainNode();
        $result['contentobject_main_node'] = $mainNode;

        // The published object may not have a node if publishing was interrupted
        $mainNodeId = $mainNode ? $mainNode->attribute( 'node_id' ) : 0;

        $result['contentobject_main_node_id'] = $mainNodeId;
        $this->setResult( array( 'node_id' => $mainNodeId,
                                 'object_id' => $object->attribute( 'id' ),
                                 'object_version' => $publishVersion ) );

        return true;
    }
866041
public static function reset($object)
	{
		if (!($object instanceof File)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\Compiler\CodeGeneratorResponse\File.');
		}
		$object->name = NULL;
		$object->insertionPoint = NULL;
		$object->content = NULL;
	}
619915
public function update($object)
    {
        if (!($object instanceof $this->objectType)) {
            throw new IllegalObjectTypeException('The modified object given to update() was not of the type (' . $this->objectType . ') this repository manages.', 1249479625);
        }
        $this->persistenceManager->update($object);
    }
465504
public function onPostSerialize(ObjectEvent $event)
    {
        /** @var Content $content */
        $content = $event->getObject();
        /** @var JsonSerializationVisitor $visitor */
        $visitor = $event->getVisitor();

        if (!($content instanceof Content)) {
            return;
        }

        foreach ($content->getData() as $key => $value) {
            $visitor->setData($key, $value);
        }

        $visitor->setData('publishedState', (WorkflowStage::PUBLISHED === $content->getWorkflowStage()));

        if (RedirectType::EXTERNAL === $content->getNodeType()) {
            $visitor->setData('linked', 'external');
        } elseif (RedirectType::INTERNAL === $content->getNodeType()) {
            $visitor->setData('linked', 'internal');
        }

        if (null !== $content->getLocalizationType()) {
            $visitor->setData('type', $content->getLocalizationType()->toArray());
        }

        $visitor->setData(
            '_permissions',
            $this->accessControlManager->getUserPermissionByArray(
                $content->getLocale(),
                PageAdmin::SECURITY_CONTEXT_PREFIX . $content->getWebspaceKey(),
                $content->getPermissions(),
                $this->tokenStorage->getToken()->getUser()
            )
        );
    }
698257
public static function reset($object)
	{
		if (!($object instanceof MethodDescriptorProto)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\MethodDescriptorProto.');
		}
		$object->name = NULL;
		$object->inputType = NULL;
		$object->outputType = NULL;
		$object->options = NULL;
		$object->clientStreaming = NULL;
		$object->serverStreaming = NULL;
	}
1116094
public function isPublish(PublishableReadInterface $object, \DateTimeInterface $currentDate = null)
    {
        $publish = $object->isPublishable();
        if ($publish && $object instanceof PublishStartReadInterface) {
            $publish = $this->isPublishStart($object, $currentDate);
        }
        if ($publish && $object instanceof PublishEndReadInterface) {
            $publish = $this->isPublishNotEnd($object, $currentDate);
        }

        return $publish;
    }
1116497
protected function write($object, $level)
    {
        if ($this->enabled && $this->writer && $level <= $this->level) {
            return $this->writer->write($object, $level);
        } else {
            return false;
        }
    }
1080522
public function set($object = null)
    {
        if (null !== $object && !$object instanceof Language) {
            throw new General\InvalidArgumentTypeException('exception_only_language_objects_are_accepted');
        }

        $this->alLanguage = $object;

        return $this;
    }