change event name

This commit is contained in:
aynsix
2019-09-24 11:28:31 +04:00
parent b30d458b64
commit e6fe8f98b6
9 changed files with 22 additions and 22 deletions

View File

@@ -15,7 +15,7 @@ use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Border\Checker\CheckerInterface; use Alchemy\Phrasea\Border\Checker\CheckerInterface;
use Alchemy\Phrasea\Border\Attribute\AttributeInterface; use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents; use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\SubdefinitionBuildEvent; use Alchemy\Phrasea\Core\Event\Record\SubdefinitionCreateEvent;
use Alchemy\Phrasea\Exception\RuntimeException; use Alchemy\Phrasea\Exception\RuntimeException;
use Alchemy\Phrasea\Metadata\Tag\TfArchivedate; use Alchemy\Phrasea\Metadata\Tag\TfArchivedate;
use Alchemy\Phrasea\Metadata\Tag\TfQuarantine; use Alchemy\Phrasea\Metadata\Tag\TfQuarantine;
@@ -335,7 +335,7 @@ class Manager
$this->app['phraseanet.metadata-setter']->replaceMetadata($newMetadata, $element); $this->app['phraseanet.metadata-setter']->replaceMetadata($newMetadata, $element);
if(!$nosubdef) { if(!$nosubdef) {
$this->app['dispatcher']->dispatch(RecordEvents::SUBDEFINITION_BUILD, new SubdefinitionBuildEvent($element, true)); $this->app['dispatcher']->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($element, true));
} }
return $element; return $element;

View File

@@ -15,7 +15,7 @@ use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Controller\RecordsRequest; use Alchemy\Phrasea\Controller\RecordsRequest;
use Alchemy\Phrasea\Controller\Exception as ControllerException; use Alchemy\Phrasea\Controller\Exception as ControllerException;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents; use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\SubdefinitionBuildEvent; use Alchemy\Phrasea\Core\Event\Record\SubdefinitionCreateEvent;
use Alchemy\Phrasea\Core\Event\RecordEdit; use Alchemy\Phrasea\Core\Event\RecordEdit;
use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Model\Entities\StoryWZ; use Alchemy\Phrasea\Model\Entities\StoryWZ;
@@ -72,7 +72,7 @@ class StoryController extends Controller
$recordAdapter = $story->set_metadatas($metadatas); $recordAdapter = $story->set_metadatas($metadatas);
// tell phraseanet to rebuild subdef // tell phraseanet to rebuild subdef
$this->dispatch(RecordEvents::SUBDEFINITION_BUILD, new SubdefinitionBuildEvent($recordAdapter)); $this->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($recordAdapter));
$storyWZ = new StoryWZ(); $storyWZ = new StoryWZ();
$storyWZ->setUser($this->getAuthenticatedUser()); $storyWZ->setUser($this->getAuthenticatedUser());

View File

@@ -16,7 +16,7 @@ use Alchemy\Phrasea\Application\Helper\SubDefinitionSubstituerAware;
use Alchemy\Phrasea\Controller\Controller; use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Controller\RecordsRequest; use Alchemy\Phrasea\Controller\RecordsRequest;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents; use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\SubdefinitionBuildEvent; use Alchemy\Phrasea\Core\Event\Record\SubdefinitionCreateEvent;
use Alchemy\Phrasea\Exception\RuntimeException; use Alchemy\Phrasea\Exception\RuntimeException;
use Alchemy\Phrasea\Metadata\PhraseanetMetadataReader; use Alchemy\Phrasea\Metadata\PhraseanetMetadataReader;
use Alchemy\Phrasea\Metadata\PhraseanetMetadataSetter; use Alchemy\Phrasea\Metadata\PhraseanetMetadataSetter;
@@ -157,7 +157,7 @@ class ToolsController extends Controller
} }
if (!$substituted || $force) { if (!$substituted || $force) {
$this->dispatch(RecordEvents::SUBDEFINITION_BUILD, new SubdefinitionBuildEvent($record)); $this->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($record));
} }
} }

View File

@@ -29,7 +29,7 @@ final class RecordEvents
const SUB_DEFINITIONS_CREATED = 'record.sub_definitions_created'; const SUB_DEFINITIONS_CREATED = 'record.sub_definitions_created';
const SUB_DEFINITION_CREATION_FAILED = 'record.sub_definition_creation_failed'; const SUB_DEFINITION_CREATION_FAILED = 'record.sub_definition_creation_failed';
const SUBDEFINITION_BUILD = 'record.subdefinition_build'; const SUBDEFINITION_CREATE = 'record.subdefinition_create';
const MEDIA_SUBSTITUTED = 'record.media_substituted'; const MEDIA_SUBSTITUTED = 'record.media_substituted';

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core\Event\Record;
use Alchemy\Phrasea\Model\RecordInterface; use Alchemy\Phrasea\Model\RecordInterface;
class SubdefinitionBuildEvent extends RecordEvent class SubdefinitionCreateEvent extends RecordEvent
{ {
private $isNewRecord; private $isNewRecord;

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core\Event\Subscriber;
use Alchemy\Phrasea\Core\Event\Record\CollectionChangedEvent; use Alchemy\Phrasea\Core\Event\Record\CollectionChangedEvent;
use Alchemy\Phrasea\Core\Event\Record\RecordEvent; use Alchemy\Phrasea\Core\Event\Record\RecordEvent;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents; use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\SubdefinitionBuildEvent; use Alchemy\Phrasea\Core\Event\Record\SubdefinitionCreateEvent;
use Alchemy\Phrasea\Core\Event\RecordEdit; use Alchemy\Phrasea\Core\Event\RecordEdit;
use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Metadata\Tag\TfEditdate; use Alchemy\Phrasea\Metadata\Tag\TfEditdate;
@@ -31,7 +31,7 @@ class RecordEditSubscriber implements EventSubscriberInterface
PhraseaEvents::RECORD_UPLOAD => 'onEdit', PhraseaEvents::RECORD_UPLOAD => 'onEdit',
RecordEvents::ROTATE => 'onRecordChange', RecordEvents::ROTATE => 'onRecordChange',
RecordEvents::COLLECTION_CHANGED => 'onCollectionChanged', RecordEvents::COLLECTION_CHANGED => 'onCollectionChanged',
RecordEvents::SUBDEFINITION_BUILD => 'onBuildSubdefs', RecordEvents::SUBDEFINITION_CREATE => 'onSubdefinitionCreate',
); );
} }
@@ -51,7 +51,7 @@ class RecordEditSubscriber implements EventSubscriberInterface
$recordAdapter->clearStampCache(); $recordAdapter->clearStampCache();
} }
public function onBuildSubdefs(SubdefinitionBuildEvent $event) public function onSubdefinitionCreate(SubdefinitionCreateEvent $event)
{ {
$recordAdapter = $this->convertToRecordAdapter($event->getRecord()); $recordAdapter = $this->convertToRecordAdapter($event->getRecord());
$recordAdapter->rebuild_subdefs(); $recordAdapter->rebuild_subdefs();

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Media;
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Event\Record\MediaSubstitutedEvent; use Alchemy\Phrasea\Core\Event\Record\MediaSubstitutedEvent;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents; use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\SubdefinitionBuildEvent; use Alchemy\Phrasea\Core\Event\Record\SubdefinitionCreateEvent;
use Alchemy\Phrasea\Filesystem\FilesystemService; use Alchemy\Phrasea\Filesystem\FilesystemService;
use MediaAlchemyst\Alchemyst; use MediaAlchemyst\Alchemyst;
use MediaAlchemyst\Exception\ExceptionInterface as MediaAlchemystException; use MediaAlchemyst\Exception\ExceptionInterface as MediaAlchemystException;
@@ -80,7 +80,7 @@ class SubdefSubstituer
$record->write_metas(); $record->write_metas();
if ($shouldSubdefsBeRebuilt) { if ($shouldSubdefsBeRebuilt) {
$this->dispatcher->dispatch(RecordEvents::SUBDEFINITION_BUILD, new SubdefinitionBuildEvent($record)); $this->dispatcher->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($record));
} }
$this->dispatcher->dispatch(RecordEvents::MEDIA_SUBSTITUTED, new MediaSubstitutedEvent($record)); $this->dispatcher->dispatch(RecordEvents::MEDIA_SUBSTITUTED, new MediaSubstitutedEvent($record));

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\TaskManager\Job;
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents; use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\SubdefinitionBuildEvent; use Alchemy\Phrasea\Core\Event\Record\SubdefinitionCreateEvent;
use Alchemy\Phrasea\Exception\RuntimeException; use Alchemy\Phrasea\Exception\RuntimeException;
use Alchemy\Phrasea\Border\File; use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Manager as borderManager; use Alchemy\Phrasea\Border\Manager as borderManager;
@@ -1035,7 +1035,7 @@ class ArchiveJob extends AbstractJob
$story->setStatus(\databox_status::operation_or($stat0, $stat1)); $story->setStatus(\databox_status::operation_or($stat0, $stat1));
$app['dispatcher']->dispatch(RecordEvents::SUBDEFINITION_BUILD, new SubdefinitionBuildEvent($story)); $app['dispatcher']->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($story));
unset($media); unset($media);

View File

@@ -19,7 +19,7 @@ use Alchemy\Phrasea\Core\Event\Record\OriginalNameChangedEvent;
use Alchemy\Phrasea\Core\Event\Record\RecordEvent; use Alchemy\Phrasea\Core\Event\Record\RecordEvent;
use Alchemy\Phrasea\Core\Event\Record\RecordEvents; use Alchemy\Phrasea\Core\Event\Record\RecordEvents;
use Alchemy\Phrasea\Core\Event\Record\StatusChangedEvent; use Alchemy\Phrasea\Core\Event\Record\StatusChangedEvent;
use Alchemy\Phrasea\Core\Event\Record\SubdefinitionBuildEvent; use Alchemy\Phrasea\Core\Event\Record\SubdefinitionCreateEvent;
use Alchemy\Phrasea\Core\PhraseaTokens; use Alchemy\Phrasea\Core\PhraseaTokens;
use Alchemy\Phrasea\Databox\Subdef\MediaSubdefRepository; use Alchemy\Phrasea\Databox\Subdef\MediaSubdefRepository;
use Alchemy\Phrasea\Filesystem\FilesystemService; use Alchemy\Phrasea\Filesystem\FilesystemService;
@@ -285,7 +285,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$this->getDataboxConnection()->executeUpdate($sql, ['type' => $type, 'record_id' => $this->getRecordId()]); $this->getDataboxConnection()->executeUpdate($sql, ['type' => $type, 'record_id' => $this->getRecordId()]);
if ($old_type !== $type) { if ($old_type !== $type) {
$this->dispatch(RecordEvents::SUBDEFINITION_BUILD, new SubdefinitionBuildEvent($this)); $this->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($this));
} }
$this->type = $type; $this->type = $type;
@@ -342,7 +342,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
array(':mime' => $mime, ':record_id' => $this->getRecordId()) array(':mime' => $mime, ':record_id' => $this->getRecordId())
)) { )) {
$this->dispatch(RecordEvents::SUBDEFINITION_BUILD, new SubdefinitionBuildEvent($this)); $this->dispatch(RecordEvents::SUBDEFINITION_CREATE, new SubdefinitionCreateEvent($this));
$this->delete_data_from_cache(); $this->delete_data_from_cache();
} }