diff --git a/app/models/Data/Base.php b/app/models/Data/Base.php index 2223d4b..59a92be 100644 --- a/app/models/Data/Base.php +++ b/app/models/Data/Base.php @@ -6,4 +6,21 @@ use Phalcon\Mvc\Model; class Base extends Model { + /** + * {@inheritdoc} + * + * Phalcon throws an exception if no valid snapshot data is present. + * + * We override this behaviour by treating no + * snapshot data (new row) as changed. + * + * @param string|array $fieldName + * @param boolean $allFields + * @return bool + */ + public function hasChanged($fieldName = null, $allFields = false) + { + return $this->hasSnapshotData() === false + || parent::hasChanged($fieldName, $allFields); + } }