Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioning support #96

Merged
merged 33 commits into from Feb 3, 2012
Merged

Versioning support #96

merged 33 commits into from Feb 3, 2012

Conversation

@dbu
Copy link
Member

@dbu dbu commented Feb 2, 2012

adding versioning support as discussed on the mailing list. please see the added doc in the readme to see how this is to be used. the rudimentary versioning support that existed before is heavily refactored. if you used it, you will need to change:

  • Document attribute versionable is now required. it must be set to either "simple" or "full"
  • the @Version annotation is gone, it makes not much sense. for old version snapshot documents, you can use @ VersionName and @VersionCreated to track the metadata.
  • checkin and checkout are now lowercased to be consistent. note that we added checkpoint for convenience
  • restore has been renamed to restoreVersion and expects as parameter an old version rather than the document and version name.
  • instead of getPredecessors (which was misnamed anyways), use getAllLinearVersions to get metadata about versions, and use findVersionByName to get a detached document of the old version of your data.

apart from that, we added a removeVersion and update to latest jackalope with lots of fixes in version handling code.

Daniel Barsotti and others added 30 commits Nov 18, 2011
- The correct versionable mixin is set on document creation, checkin and checkout
- A document cannot have a @Version field if it is not versionable
- Corrected the exiting version related tests
…rom test documents

Conflicts:
	README.md
	lib/Doctrine/ODM/PHPCR/UnitOfWork.php
	lib/vendor/jackalope
	tests/Doctrine/Tests/ODM/PHPCR/Functional/VersioningTest.php
$node->addMixin('mix:simpleVersionable');
} elseif ($metadata->versionable === 'full') {
$node->addMixin('mix:versionable');
} elseif ($metadata->versionable) {
Copy link
Member

@lsmith77 lsmith77 Feb 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for those 2 last "else"

Loading

Copy link
Member Author

@dbu dbu Feb 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i removed the check whether the document is versionable of an unknown type.
but i want to keep the last line, we call this method on checkin and checkout as well, whithout sanitizing. and there we want to notice if somebody tries to checkin a document that is not versionable.

Loading

Copy link
Member

@lsmith77 lsmith77 Feb 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah no .. my point wasn't that the exception throwing should be removed .. but actually my comment was bogus .. never mind :)

Loading

@@ -14,7 +14,7 @@
public $nodeType = 'nt:unstructured';
/** @var string */
public $repositoryClass;
/** @var boolean */
/** @var string */
public $versionable = false;
Copy link
Member

@stof stof Feb 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string with a boolean default ? this seems weird

Loading

Copy link
Member Author

@dbu dbu Feb 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the default

Loading

@dbu
Copy link
Member Author

@dbu dbu commented Feb 2, 2012

i will merge tomorrow unless somebody finds more issues. went through the api with lukas again and he is ok with it.

Loading

@lsmith77
Copy link
Member

@lsmith77 lsmith77 commented Feb 3, 2012

Loading

lsmith77 added a commit that referenced this issue Feb 3, 2012
@lsmith77 lsmith77 merged commit a574615 into doctrine:master Feb 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants