Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 54 additions & 19 deletions en/appendices/3-5-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ The following is a list of methods that are deprecated and replaced with
* ``tableLocator()``
``Cake\ORM\Table``
* ``validator()``
``Cake\Routing\RouteCollection``
* ``extensions()``
``Cake\TestSuite\TestFixture``
* ``schema()``
``Cake\Utility\Security``
Expand Down Expand Up @@ -112,6 +114,22 @@ behavior that may affect your application:
New Features
============

Core
----

* ``Cake\Core\ObjectRegistry`` now implements the ``Countable`` and
``IteratorAggregate`` interfaces.

Console
-------

* ``Cake\Console\ConsoleOptionParser::setHelpAlias()`` was added. This method
allows you to set the command name used when generating help output. Defaults
to ``cake``.

Http
----

* New Cookie & CookieCollection classes have been added. These classes allow you
to work with cookies in an object-orientated way, and are available on
``Cake\Http\ServerRequest``, ``Cake\Http\Repsonse``, and
Expand All @@ -123,37 +141,54 @@ New Features
:ref:`encrypted-cookie-middleware` for more information.
* New middleware has been added to make protecting against CSRF easier. See
:ref:`csrf-middleware` for more information.
* ``Cake\Http\Client::addCookie()`` was added to make it easy to add cookies to
a client instance.

Event
-----

* ``Cake\Event\EventManager::on()`` and ``off()`` methods are now chainable
making it simpler to set multiple events at once.
* ``Cake\Validation\Validator::regex()`` was added for a more convenient way
to validate data against a regex pattern.
* ``Cake\Routing\Router::reverseToArray()`` was added. This method allow you to
convert a request object into an array that can be used to generate URL
strings.

ORM
---

* ``Cake\Datasource\SchemaInterface`` was added.
* New abstract types were added for ``smallinteger`` and ``tinyinteger``.
Existing ``SMALLINT`` and ``TINYINT`` columns will now be reflected as these
new abstract types. ``TINYINT(1)`` columns will continue to be treated as
boolean columns in MySQL.
* ``Cake\ORM\Query::contain()`` now allows you to call it without the wrapping
array when containing a single association. ``contain('Comments', function ()
{ ... });`` will now work. This makes ``contain()`` consistent with other
eagerloading related methods like ``leftJoinWith()`` and ``matching()``.

Routing
-------

* ``Cake\Routing\Router::reverseToArray()`` was added. This method allow you to
convert a request object into an array that can be used to generate URL
strings.
* ``Cake\Routing\RouteBuilder::resources()`` had the ``path`` option
added. This option lets you make the resource path and controller name not
match.
* New abstract types were added for ``smallinteger`` and ``tinyinteger``.
Existing ``SMALLINT`` and ``TINYINT`` columns will now be reflected as these
new abstract types. ``TINYINT(1)`` columns will continue to be treated as
boolean columns in MySQL.
* ``Cake\Routing\RouteBuilder`` now has methods to create routes for
specific HTTP methods. e.g ``get()`` and ``post()``.
* ``Cake\Routing\Route`` now has fluent methods for defining options.

Validation
----------
* ``Cake\Validation\Validator::regex()`` was added for a more convenient way
to validate data against a regex pattern.
* ``Cake\Validation\Validator::addDefaultProvider()`` was added. This method
lets you inject validation providers into all the validators created in your
application.
* ``Cake\Validation\ValidatorAwareInterface`` was added to define the methods
implemented by ``Cake\Validation\ValidatorAwareTrait``.

View
----

* ``Cake\View\Helper\PaginatorHelper::limitControl()`` was added. This method
lets you create a form with a select box for updating the limit value on
a paginated result set.
* ``Cake\Core\ObjectRegistry`` now implements the ``Countable`` and
``IteratorAggregate`` interfaces.
* ``Cake\Console\ConsoleOptionParser::setHelpAlias()`` was added. This method
allows you to set the command name used when generating help output. Defaults
to ``cake``.
* ``Cake\Datasource\SchemaInterface`` was added.
* ``Cake\Validation\ValidatorAwareInterface`` was added to define the methods
implemented by ``Cake\Validation\ValidatorAwareTrait``.
* ``Cake\Http\Client::addCookie()`` was added to make it easy to add cookies to
a client instance.
Loading