thelia/thelia — pull request #829 by roadster31 (2014-10-29 15:47:41+00:00)
Title: Session cart management refactoring

This PR changes the Cart management in the Session object.

To get the current cart from the session, one's should now use the `getSessionCart()` method, which perform all required steps to retrieve the customer cart if it is not currently present in the session. The method uses the dispatcher to invoke the Cart action, in which the Cart management code is now located.
Example of getting the current Cart in a controller :

`$cart = $this->getSession()->getSessionCart($this->getDispatcher());`

`getSessionCart()` guaranteed that a Cart object is returned in all situations.

The `Session::getCart()` method is still there, but is now deprecated, and becomes an alias of `getSessionCart()`. When calling `getCart()`, if no previous call was made to `getSessionCart()` somewhere else in the code, the Cart is not present in session, and could not be retrieved, as no dispatcher is provided. An exception is thrown in such cases.
In the previous implementation, `getCart()` returned null.

The `CartTrait` is no longer useful, and has been removed.

Some minor improvements have been done, such as defining the `cart.*` config variables in the SQL files.