Cakephp Classroom image

deepa
 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79|Last
Lessons:-Models

Model Attributes
Model attributes allow you to set properties that can override the default model behavior.
For a complete list of model attributes and their descriptions visit the CakePHP API. Check out
http://api20.cakephp.org/class/model.
useDbConfig
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.
Example usage:
class Example extends AppModel {
public $useDbConfig = ’alternate’;
}
useTable
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:
class Example extends AppModel {
public $useTable = false; // This model does not use a database table
}
Alternatively:
class Example extends AppModel {
public $useTable = ’exmp’; // This model uses a database table ’exmp’
}
tablePrefix
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:
class Example extends AppModel {
public $tablePrefix = ’alternate_’; // will look for ’alternate_examples’
}

 
 
 

deepa

Skills    Cakephp

Qualifications :-
Location :-,,,
Description:-
Explore
 

  Students (0)