The useDbConfig property is a string that specifies the name of
the database connection to use to bind your model class to the
related database table. You can set it to any of the database
connections defined within your database configuration file. The
database configuration file is stored in /app/Config/database.php.

The useDbConfig property is defaulted to the ‘default’ database
connection.

The useTable property specifies the database table name. By
default, the model uses the lowercase, plural form of the model’s
class name. Set this attribute to the name of an alternate table,
or set it to false if you wish the model to use no database
table.

Example usage:

classExampleextendsAppModel{public$useTable=false;// This model does not use a database table}

The name of the table prefix used for the model. The table prefix
is initially set in the database connection file at
/app/Config/database.php. The default is no prefix. You can
override the default by setting the tablePrefix attribute in
the model.

Example usage:

classExampleextendsAppModel{public$tablePrefix='alternate_';// will look for 'alternate_examples'}

The displayField attribute specifies which database field
should be used as a label for the record. The label is used in
scaffolding and in find('list') calls. The model will use
name or title, by default.

For example, to use the username field:

classUserextendsAppModel{public$displayField='username';}

Multiple field names cannot be combined into a single display
field. For example, you cannot specify,
array('first_name','last_name') as the display field. Instead
create a virtual field with the Model attribute virtualFields

Imagine your application features Groups which belong to a Domain
and have many Users which in turn have many Articles. You can set
$recursive to different values based on the amount of data you want
back from a $this->Group->find() call:

-1 CakePHP fetches Group data only, no joins.

0 CakePHP fetches Group data and its Domain

1 CakePHP fetches a Group, its Domain and its associated Users

2 CakePHP fetches a Group, its Domain, its associated Users, and the
Users’ associated Articles

Set it no higher than you need. Having CakePHP fetch data you
aren’t going to use slows your app unnecessarily. Also note that
the default recursive level is 1.

Note

If you want to combine $recursive with the fields
functionality, you will have to add the columns containing the
required foreign keys to the fields array manually. In the
example above, this could mean adding domain_id.

The recommended recursive level for your application should be -1.
This avoids retrieving related data where that is unnecessary or even
unwanted. This is most likely the case for most of your find() calls.
Raise it only when needed or use Containable behavior.

You can achieve that by adding it to the AppModel:

public$recursive=-1;

If you use events in your system, using the value -1 for recursive will
disable all event triggering in the associated model. This happens because
no relations are created when the value is set to -1.

The container for the model’s fetched data. While data returned
from a model class is normally used as returned from a find() call,
you may need to access information stored in $data inside of model
callbacks.

In subsequent find operations, your User results would contain a
name key with the result of the concatenation. It is not
advisable to create virtual fields with the same names as columns
on the database, this can cause SQL errors.

For more information on the virtualFields property, its proper
usage, as well as limitations, see
Virtual fields.

If set to true, data fetched by the model during a single request
is cached. This caching is in-memory only, and only lasts for the
duration of the request. Any duplicate requests for the same data
is handled by the cache.