Cakephp Classroom image

osdyui
 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83|Last
Lessons:-Models

validate
This attribute holds rules that allow the model to make data validation decisions before saving. Keys named
after fields hold regex values allowing the model to try to make matches.
Note: It is not necessary to call validate() before save() as save() will automatically validate your data
before actually saving.
For more information on validation, see the Data Validation later on in this manual.
virtualFields
Array of virtual fields this model has. Virtual fields are aliased SQL expressions. Fields added to this
property will be read as other fields in a model but will not be saveable.
Example usage for MySQL:
public $virtualFields = array(
’name’ => "CONCAT(User.first_name, ’ ’, User.last_name)"
);
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.
name
Name of the model. If you do not specify it in your model file it will be set to the class name by constructor.
Example usage:
class Example extends AppModel {
public $name = ’Example’;
}
cacheQueries
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.

 
 
 

osdyui

Skills    Cakephp

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

  Students (0)