Configuration ============= Setup ~~~~~ Paris requires `Idiorm`_. Install Idiorm and Paris somewhere in your project directory, and ``require`` both. .. code-block:: php find_many(); // SQL executed: SELECT * FROM `tests_simple` Model::factory('SimpleUser')->find_many(); // SQL executed: SELECT * FROM `tests_simple_user` Model prefixes are only compatible with the ``Model::factory()`` methods described above. Where the shorter ``SimpleUser::find_many()`` style syntax is used, the addition of a Model prefix will cause ``Class not found`` errors. .. note:: Model class property ``$_table`` sets an explicit table name, ignoring the ``$auto_prefix_models`` property in your individual model classes. See documentation in the :doc:`Models` section of the documentation. Model prefixing ~~~~~~~~~~~~~~~ Setting: ``Model::$short_table_names`` Set as ``true`` to disregard namespace information when computing table names from class names. By default the class ``\Models\CarTyre`` expects the table name ``models_car_tyre``. With ``Model::$short_table_names = true`` the class ``\Models\CarTyre`` expects the table name ``car_tyre``. .. code-block:: php find_many(); // SQL executed: SELECT * FROM `car_tyre` namespace Models { class CarTyre extends Model { } } Further Configuration ~~~~~~~~~~~~~~~~~~~~~ The only other configuration options provided by Paris itself are the ``$_table`` and ``$_id_column`` static properties on model classes. To configure the database connection, you should use Idiorm’s configuration system via the ``ORM::configure`` method. If you are using multiple connections, the optional `$_connection_key` static property may also be used to provide a default string key indicating which database connection in `ORM` should be used. **See `Idiorm's documentation`_ for full details.** Query logging ~~~~~~~~~~~~~ Idiorm can log all queries it executes. To enable query logging, set the ``logging`` option to ``true`` (it is ``false`` by default). .. code-block:: php