cakephp/cakephp — pull request #685 by adael (2012-06-06 13:07:47+00:00)
Title: 2.2 - Model getter function

I have add to Model two functions (and the corresponding tests in ModelReadTest):

public function get($field, $defaultValue = null);
public function check($field);

To facilitate use of data in model and get rid of

$User->data[$User->alias]['user_name'];

that could be

$User->get('name');

You get values from related models (if they are loaded into data)

$User->id = 1;
$User->contain('Profile');
$User->read();
$User->get('Profile.real_name);

I have more proposals on model layer, but are difficult for me to explain them in english, so I'm trying to send the pull requests atomic and concise.

Hope you like!
Best regards.