tags:

views:

22

answers:

1

How can i get the Doctrine_Record's unchanged version of field data. For example;

echo $user->username; // Prints 'David'
$user->username = 'John';
echo $user->username; // Prints 'John'

How to get the pre-changed value (David)?

+1  A: 
$modified = $user->getModified(true);

or if you have access to protected fields:

if (in_array('username', $this->_modified)) {
    // username changed
}
Vladimir