2010-03-24 8 views
0

Doctrine_Record의 변경되지 않은 버전의 필드 데이터는 어떻게 얻을 수 있습니까? 예를 들어;변경되지 않은 데이터 검색

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

사전 변경 값 (David)을 얻는 방법은 무엇입니까?

+0

당신은 이전에 절약을 의미합니까? – richsage

+0

그냥 변수에 저장하십시오. – Tom

+0

로깅 시스템에 대해 변경된 필드를 확인해야합니다. 예를 들어, 사용자 X는 News Id 3의 "news_category"필드를 "Flash News"로 변경했습니다. – cnkt

답변

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

또는 보호 필드에 액세스 할 수있는 경우 :

if (in_array('username', $this->_modified)) { 
    // username changed 
} 
관련 문제