eZ\Publish\Core\Persistence\Legacy\Content\Type\Handler::publish PHP Method

publish() public method

Updates content objects, depending on the changed field definitions. A content type has a state which tells if its content objects yet have been adapted. Flags the content type as updated.
public publish ( mixed $contentTypeId )
$contentTypeId mixed
    public function publish($contentTypeId)
    {
        $toType = $this->load($contentTypeId, Type::STATUS_DRAFT);
        try {
            $fromType = $this->load($contentTypeId, Type::STATUS_DEFINED);
            $this->updateHandler->updateContentObjects($fromType, $toType);
            $this->updateHandler->deleteOldType($fromType);
        } catch (Exception\TypeNotFound $e) {
            // If no old type is found, no updates are necessary to it
        }
        $this->updateHandler->publishNewType($toType, Type::STATUS_DEFINED);
    }