<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stevecohenfr / legacy-publish-handler-bundle example snippets
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new SteveCohenFr\LegacyPublishHandlerBundle\SteveCohenFrLegacyPublishHandlerBundle(),
);
// ...
}
// ...
}
namespace ACME\ACMEBundle\Handlers;
use eZ\Publish\API\Repository\Values\Content\Content;
use SteveCohenFr\LegacyPublishHandlerBundle\Classes\LegacyPublishHandlerInterface;
class OnPublishHandler implements LegacyPublishHandlerInterface
{
/**
* This function is called from legacy part before an object publication (called by workflow)
* You must link the "before publish" trigger to the custom workflow
*
* @param Content $content The legacy object
* @param int $version The object version
*
*/
function beforePublish(Content $content, $version)
{
//TODO this function will be called before the content is published
}
/**
* This function is called from legacy part after an object publication (called by workflow)
* You must link the "after publish" trigger to the custom workflow
*
* @param Content $content The legacy object
* @param int $version The object version
*
*/
function afterPublish(Content $content, $version)
{
//TODO this function will be called after the content is published
}
}