Skip to content

Commit

Permalink
Issue #156: document find_many with primary key as index
Browse files Browse the repository at this point in the history
  • Loading branch information
treffynnon committed Oct 7, 2013
1 parent 8b11243 commit d627076
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,25 @@ See the `find_result_set()` documentation for more information.
It is recommended that you setup your projects to use result sets as they
are more flexible.

``find_many()`` to index records by primary key
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Setting: ``find_many_primary_id_as_key``
Default: true

This setting causes Idiorm to use the primary key of a record as it's index in
the returned array.

.. warning::

If you are not using Idiorm with a proper unique primary key then you can set
this to false so that you do not get duplicate records overwriting each other.

.. code-block:: php
<?php
ORM::configure('find_many_primary_id_as_key', true); // returns records indexed by primary key
PDO Driver Options
^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit d627076

Please sign in to comment.