Fix the containers positions.

@param ContentInterface $content

@return ContentManager
192933
public function fixContainersPositions(ContentInterface $content)
    {
        $this->sortChildrenByPosition($content, 'containers');

        $containers = $content->getContainers();

        $position = 0;
        foreach ($containers as $container) {
            $container->setPosition($position);
            $position++;
        }

        return $this;
    }
1011257
public function delete($content)
    {
        if (!$content instanceof ContentInterface) {
            throw new IndexorWrongParameterException();
        }

        $index = $this->client->getIndex($this->indexName);
        $type = $index->getType(ContentTypeSchemaGenerator::INDEX_TYPE . $content->getContentType());
        $document = $this->transformer->transform($content);
        try {
            $type->deleteDocument($document);
            $index->refresh();
        } catch (NotFoundException $e) {

        }
    }
45468
public function load(Content $content): self
    {
        $versionInfo = $content->getVersionInfo();

        foreach ($this->contentService->loadRelations($versionInfo) as $relation) {
            $this->relations[] = $this->valueFactory->createRelation($relation, $content);
        }

        foreach ($this->contentService->loadReverseRelations($versionInfo->getContentInfo()) as $reverseRelation) {
            $this->reverseRelations[] = $this->valueFactory->createRelation($reverseRelation, $content);
        }

        return $this;
    }
403436
public function prepare(ContentInterface $content, ThemeInterface $theme, $templateTypeName = null)
    {
        $this->contextStack->push(
            $this->contextBuilder
                ->setContent($content)
                ->setTheme($theme)
                ->setTemplateTypeName($templateTypeName)
            ->createContext()
        );

        return $this;
    }
207716
public function putContent($content)
    {
        // write to io stream
        $this->size = fwrite($this->inputStream, $content);
        // rewind file pointer
        rewind($this->inputStream);
    }
148459
public function setContent($content)
    {
        if (!is_null($content)) {
            $content = (string) $content;
        }

        $this->content = $content;
        return $this;
    }
285553
public function prependContent($content)
    {
        if ($this->isVoid) {
            throw new Exception\RuntimeException(
                'Void elements can\'t contain content.'
            );
        }

        $this->content = $content . $this->content;

        return $this;
    }
254575
public function setContent($content)
    {
        if (is_null($this->mbRequest)) {
            return $this;
        }

        $this->prepare($this->mbRequest);

        if ($this->mbRequest->isMethod("GET") || $this->mbRequest->isMethod("DELETE")) {
            $this->statusCode = BaseResponse::HTTP_OK;
        } elseif ($this->mbRequest->isMethod("POST") || $this->mbRequest->isMethod("PUT")) {
            $this->statusCode = BaseResponse::HTTP_CREATED;
        } else {
            $this->statusCode = BaseResponse::HTTP_RESET_CONTENT;
        }

        if ($content instanceof \Exception) {
            $this->statusCode = $content->getCode();
            $this->statusCode = $this->isSuccessful() ? $this->statusCode : BaseResponse::HTTP_BAD_REQUEST;
        }

        if($this->isBuffer()){
            $this->original = $content;
        } elseif ($this->mbRequest->isAjax()) {
            $this->ajaxContent($content);
        } else {
            $this->htmlContent($content);
        }

        return $this;
    }
603963
protected function createEntityFromContent(string $content): EntityInterface
    {
        $result = $this->createEntity();
        $result->readData(new DataContainer($this->decodeContent($content)));
        return $result;
    }
169030
public function fill($content)
    {
        if ($this->hasInstructions($content)) {
            $instructions = $this->getInstructions();
            foreach ($instructions as $instruction) {
                $content = $this->parseInstructions($content, $instruction);
            }
        }
        return $this->fillContent($content);
    }
1270322
public function setContent($content)
    {

        if (!is_null($content) && (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $content))) {
            throw new \InvalidArgumentException("invalid value for $content when calling SendSmtpEmailAttachment., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.");
        }

        $this->container['content'] = $content;

        return $this;
    }
1368132
public function write($content)
    {
        fseek($this->resource, $this->writePosition);
        if(false === fwrite($this->resource, $content))
            throw new ResourceException("Unable to write content to resource");
        $this->writePosition = ftell($this->resource);
        return $this;
    }
1267150
public function canDelete(ContentInterface $content, array $parameters)
    {
        return $this->isContentOnSiteAllowed($content) && false === $this->contentRepository->hasContentIdWithoutAutoUnpublishToState($content->getContentId());
    }
244484
public function setContent(Content $content)
    {
        $this->contentTypeName = $content->getType()->getName();
        $this->contentId = $content->getContentId();

        return parent::setContent($content);
    }
1134621
protected function append( string$content ):self
	{
		if( $this->currentSection ){
			$this->currentSection->append($content);
		}else{
			$this->content.=$content;
		}

		return $this;
	}
242169
protected function cloneContent(ContentInterface $content)
    {
        $newContent = clone $content;
        if (false === $content->getStatus()->isOutOfWorkflow()) {
            $status = $this->statusRepository->findOneByInitial();
            $newContent->setStatus($status);
        }
        $newContent->setVersion($this->uniqueIdGenerator->generateUniqueId());
        foreach ($content->getKeywords() as $keyword) {
            $newContent->addKeyword($keyword);
        }
        foreach ($content->getAttributes() as $attribute) {
            $newAttribute = clone $attribute;
            $newContent->addAttribute($newAttribute);
        }

        return $newContent;
    }
929406
public function setContent($content)
    {
        if (!$json = json_encode($content)) {
            $this->setResponseCode(self::HTTP_INTERNAL_SERVER_ERROR);
            $json = json_encode(['status' => 'error', 'error_message' => json_last_error_msg()]);
        }

        $this->content = $json;

        return $this;
    }