eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater::applyUpdates PHP Method

applyUpdates() public method

Applies all given updates.
public applyUpdates ( mixed $contentTypeId, array $actions )
$contentTypeId mixed
$actions array
    public function applyUpdates($contentTypeId, array $actions)
    {
        if (empty($actions)) {
            return;
        }
        foreach ($this->getContentIdsByContentTypeId($contentTypeId) as $contentId) {
            foreach ($actions as $action) {
                $action->apply($contentId);
            }
        }
    }

Usage Example

 /**
  * Updates existing content objects from $fromType to $toType
  *
  * @param \eZ\Publish\SPI\Persistence\Content\Type $fromType
  * @param \eZ\Publish\SPI\Persistence\Content\Type $toType
  *
  * @return void
  */
 public function updateContentObjects(Type $fromType, Type $toType)
 {
     $this->contentUpdater->applyUpdates($fromType->id, $this->contentUpdater->determineActions($fromType, $toType));
 }