PHP 클래스 VersionPress\Utils\EntityUtils

파일 보기 프로젝트 열기: versionpress/versionpress 1 사용 예제들

공개 메소드들

메소드 설명
getDiff ( array $oldEntityData, array $newEntityData ) : array Used by storages to determine a diff between two entity data. Note that the data might not be complet - for example, the $oldEntityData might be the previous, full state of the entity while the $newEntityData is just the change that was captured by VersionPress.

비공개 메소드들

메소드 설명
isChanged ( $oldData, $newValue ) : boolean Evaluates if there is difference between old and new value.

메소드 상세

getDiff() 공개 정적인 메소드

Or the $newEntityData might be another full entity, for example in its new state. It doesn't really matter, the algo is always the same: it scans for new keys in $newEntityData and changed values on existing keys and adds those two things to the result. 'vp_id' key is ignored by default. Note: keys may never be "removed" (or marked as removed) in the diff because that will just not ever happen - the SQL UPDATE command is only capable of sending a change, clearing a key value at most but never "removing" it entirely.
public static getDiff ( array $oldEntityData, array $newEntityData ) : array
$oldEntityData array Usually a full entity data in its original state
$newEntityData array Full or partial data of the new entity
리턴 array Key=>value pairs of things that are new or changed in $newEntity (they can never be "removed", that will never happen when capturing SQL UPDATE actions)