Skip to content

Commit

Permalink
Deprecate MongoDB / PHPCR related classes, services and parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Jul 3, 2018
1 parent 45003b5 commit 76944be
Show file tree
Hide file tree
Showing 21 changed files with 76 additions and 0 deletions.
37 changes: 37 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# UPGRADE FROM `v1.X.X` TO `v2.0.0`

## Codebase

* Doctrine MongoDB and PHPCR is not longer supported in ResourceBundle and GridBundle:

* The following classes were removed:

* `Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\DataSource`
* `Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\Driver`
* `Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\ExpressionBuilder`
* `Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\ExpressionBuilderInterface`
* `Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\ExpressionVisitor`
* `Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\ExtraComparison`
* `Sylius\Bundle\ResourceBundle\DependencyInjection\Driver\Doctrine\DoctrineODMDriver`
* `Sylius\Bundle\ResourceBundle\DependencyInjection\Driver\Doctrine\DoctrinePHPCRDriver`
* `Sylius\Bundle\ResourceBundle\Doctrine\ODM\MongoDB\DocumentRepository`
* `Sylius\Bundle\ResourceBundle\Doctrine\ODM\MongoDB\TranslatableRepository`
* `Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\EventListener\DefaultParentListener`
* `Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\EventListener\NameFilterListener`
* `Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\EventListener\NameResolverListener`
* `Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\Form\Builder\DefaultFormBuilder`
* `Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\DocumentRepository`
* `Sylius\Bundle\ResourceBundle\EventListener\ODMMappedSuperClassSubscriber`
* `Sylius\Bundle\ResourceBundle\EventListener\ODMRepositoryClassSubscriber`
* `Sylius\Bundle\ResourceBundle\EventListener\ODMTranslatableListener`

* The following services were removed:

* `sylius.event_subscriber.odm_mapped_super_class`
* `sylius.event_subscriber.odm_repository_class`
* `sylius.grid_driver.doctrine.phpcrodm`

* The following parameters were removed:

* `sylius.mongodb_odm.repository.class`
* `sylius.phpcr_odm.repository.class`
2 changes: 2 additions & 0 deletions src/Sylius/Bundle/GridBundle/Doctrine/PHPCRODM/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Sylius\Component\Grid\Data\ExpressionBuilderInterface;
use Sylius\Component\Grid\Parameters;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', DataSource::class), E_USER_DEPRECATED);

final class DataSource implements DataSourceInterface
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/Sylius/Bundle/GridBundle/Doctrine/PHPCRODM/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use Sylius\Component\Grid\Data\DriverInterface;
use Sylius\Component\Grid\Parameters;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', Driver::class), E_USER_DEPRECATED);

final class Driver implements DriverInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Doctrine\Common\Collections\Expr\Comparison;
use Doctrine\Common\Collections\ExpressionBuilder as CollectionsExpressionBuilder;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', ExpressionBuilder::class), E_USER_DEPRECATED);

/**
* Creates an object graph (using Doctrine\Commons\Collections\Expr\*) which we
* can then walk in order to build up the PHPCR-ODM query builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

use Sylius\Component\Grid\Data\ExpressionBuilderInterface as BaseExpressionBuilderInterface;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', ExpressionBuilderInterface::class), E_USER_DEPRECATED);

interface ExpressionBuilderInterface extends BaseExpressionBuilderInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use Doctrine\ODM\PHPCR\Query\Builder\AbstractNode;
use Doctrine\ODM\PHPCR\Query\Builder\QueryBuilder;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', ExpressionVisitor::class), E_USER_DEPRECATED);

/**
* Walks a Doctrine\Commons\Expr object graph and builds up a PHPCR-ODM
* query using the (fluent) PHPCR-ODM query builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace Sylius\Bundle\GridBundle\Doctrine\PHPCRODM;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', ExtraComparison::class), E_USER_DEPRECATED);

/**
* Contains constants values for comparisons which are not supported
* by the Doctrine\Common\Collection\Expr\Comparison class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<service id="sylius.grid_driver.doctrine.phpcrodm" class="Sylius\Bundle\GridBundle\Doctrine\PHPCRODM\Driver">
<argument type="service" id="doctrine_phpcr.odm.document_manager" />
<tag name="sylius.grid_driver" alias="doctrine/phpcr-odm" />
<deprecated>The "sylius.grid_driver.doctrine.phpcrodm" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
</service>
</services>
</container>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\Reference;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', DoctrineODMDriver::class), E_USER_DEPRECATED);

final class DoctrineODMDriver extends AbstractDoctrineDriver
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\Reference;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', DoctrinePHPCRDriver::class), E_USER_DEPRECATED);

final class DoctrinePHPCRDriver extends AbstractDoctrineDriver
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Sylius\Component\Resource\Model\ResourceInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', DocumentRepository::class), E_USER_DEPRECATED);

/**
* Doctrine ODM driver resource manager.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Doctrine\MongoDB\Query\Builder as QueryBuilder;
use Sylius\Component\Resource\Repository\TranslatableRepositoryInterface;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', TranslatableRepository::class), E_USER_DEPRECATED);

/**
* Doctrine ORM driver translatable entity repository.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Sylius\Component\Resource\Model\ResourceInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', DocumentRepository::class), E_USER_DEPRECATED);

/**
* Doctrine PHPCR-ODM driver document repository.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use PHPCR\Util\NodeHelper;
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', DefaultParentListener::class), E_USER_DEPRECATED);

/**
* Automatically set the parent brefore the creation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Doctrine\ODM\PHPCR\DocumentManagerInterface;
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', NameFilterListener::class), E_USER_DEPRECATED);

/**
* Filter the node name field, replacing invalid characters with a substitute
* characters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Doctrine\ODM\PHPCR\Mapping\ClassMetadata;
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', NameResolverListener::class), E_USER_DEPRECATED);

/**
* Handles the resolution of the PHPCR node name field.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use Sylius\Component\Resource\Metadata\MetadataInterface;
use Symfony\Component\Form\FormBuilderInterface;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', DefaultFormBuilder::class), E_USER_DEPRECATED);

class DefaultFormBuilder implements DefaultFormBuilderInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', ODMMappedSuperClassSubscriber::class), E_USER_DEPRECATED);

/**
* Doctrine listener used to manipulate mappings.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use Doctrine\ODM\MongoDB\Events;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', ODMRepositoryClassSubscriber::class), E_USER_DEPRECATED);

final class ODMRepositoryClassSubscriber extends AbstractDoctrineSubscriber
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
use Sylius\Component\Resource\Model\TranslatableInterface;
use Sylius\Component\Resource\Model\TranslationInterface;

@trigger_error(sprintf('The "%s" class is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.', ODMTranslatableListener::class), E_USER_DEPRECATED);

final class ODMTranslatableListener implements EventSubscriber
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
<service id="sylius.event_subscriber.odm_mapped_super_class" class="Sylius\Bundle\ResourceBundle\EventListener\ODMMappedSuperClassSubscriber">
<argument type="service" id="sylius.resource_registry" />
<tag name="doctrine_mongodb.odm.event_subscriber" priority="8192" />
<deprecated>The "sylius.event_subscriber.odm_mapped_super_class" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
</service>

<service id="sylius.event_subscriber.odm_repository_class" class="Sylius\Bundle\ResourceBundle\EventListener\ODMRepositoryClassSubscriber">
<argument type="service" id="sylius.resource_registry" />
<tag name="doctrine_mongodb.odm.event_subscriber" priority="8192" />
<deprecated>The "sylius.event_subscriber.odm_repository_class" service is deprecated since Sylius 1.3. Doctrine MongoDB and PHPCR support will no longer be supported in Sylius 2.0.</deprecated>
</service>
</services>
</container>
Expand Down

0 comments on commit 76944be

Please sign in to comment.