Skip to content

Commit

Permalink
Merge pull request #5911 from mbabker/resolver-refs
Browse files Browse the repository at this point in the history
Remove the remaining resolver references
  • Loading branch information
Paweł Jędrzejewski committed Aug 30, 2016
2 parents 102aeb2 + 1c3e513 commit b09f995
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
23 changes: 3 additions & 20 deletions docs/bundles/SyliusCartBundle/services.rst
Expand Up @@ -39,10 +39,10 @@ You're interacting with them like you usually do with own entities in your proje
$item = $this->get('sylius.repository.cart')->createNew();
}
Provider and Resolver
---------------------
Provider
--------

There are also 3 more services for you.
There is also 1 more service for you.

You use the provider to obtain the current user cart, if there is none, a new one is created and saved.
The ``->setCart()`` method also allows you to replace the current cart.
Expand All @@ -62,20 +62,3 @@ This is useful, for example, when after completing an order you want to start wi
$provider->setCart($customCart);
$provider->abandonCart();
}
The resolver is used to create a new item based on the user request.

.. code-block:: php
<?php
// ...
public function addItemAction(Request $request)
{
$resolver = $this->get('sylius.cart_resolver');
$item = $resolver->resolve($this->createNew(), $request);
}
.. note::

A more advanced example of a resolver implementation is available `in Sylius Sandbox application on GitHub <https://github.com/Sylius/Sylius-Sandbox/blob/master/src/Sylius/Bundle/SandboxBundle/Resolver/ItemResolver.php>`_.
Expand Up @@ -48,7 +48,6 @@ public function getConfigTreeBuilder()
->addDefaultsIfNotSet()
->children()
->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->cannotBeEmpty()->end()
->scalarNode('resolver')->isRequired()->cannotBeEmpty()->end()
->end()
;

Expand Down
Expand Up @@ -49,8 +49,6 @@ public function load(array $config, ContainerBuilder $container)
$loader->load($configFile);
}

$container->setAlias('sylius.cart_resolver', $config['resolver']);

$definition = $container->getDefinition('sylius.form.type.cart_item');
$definition->addArgument(new Reference('sylius.form.data_mapper.order_item_quantity'));
}
Expand Down
Expand Up @@ -27,7 +27,6 @@ sylius_association:
interface: Sylius\Component\Product\Model\ProductAssociationInterface

sylius_cart:
resolver: sylius.cart_item_resolver.default
resources:
cart:
classes:
Expand Down

0 comments on commit b09f995

Please sign in to comment.