plugin/tag/Manager/TagManager.php
private function getUowScheduledTag($name, User $user = null)
    {
        $scheduledForInsert = $this->om->getUnitOfWork()->getScheduledEntityInsertions();
        foreach ($scheduledForInsert as $entity) {
            /** @var Tag $entity */
            if ($entity instanceof Tag
                && $name === $entity->getName()
                && $user === $entity->getUser()) {
                return $entity;
            }
        }

        return null;
    }
private function getUowScheduledTag($name, User $user = null)
    {
        $scheduledForInsert = $this->om->getUnitOfWork()->getScheduledEntityInsertions();
        foreach ($scheduledForInsert as $entity) {
            /** @var Tag $entity */
            if ($entity instanceof Tag
                && $name === $entity->getName()
                && $user === $entity->getUser()) {
                return $entity;
            }
        }

        return null;
    }
private function getUowScheduledTag ( $ name , User $ user = null ) { $ scheduledForInsert = $ this -> om -> getUnitOfWork ( ) -> getScheduledEntityInsertions ( ) ; foreach ( $ scheduledForInsert as $ entity ) { /** @var Tag $entity */ if ( $ entity instanceof Tag && $ name === $ entity -> getName ( ) && $ user === $ entity -> getUser ( ) ) { return $ entity ; } } return null ; }
Avoids duplicate creation of a tag when inside a flushSuite.
The only way to do that is to search in the current UOW if a tag with the same name
is already scheduled for insertion.

@param string $name
@param User   $user

@return Tag|null
Avoids duplicate creation of a tag when inside a flushSuite . The only way to do that is to search in the current UOW if a tag with the same name is already scheduled for insertion .