Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 11b7e26

Browse files
committedOct 15, 2013
fix issues in tutorial
1 parent 4d8e858 commit 11b7e26

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
 

‎tutorial/Tutorial.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,16 @@ at that point, called "frozen node".
521521
$oldversion = $version->getLinearPredecessor();
522522
// the version objects are just the meta data. call getFrozenNode on them
523523
// to get a snapshot of the data when the version was created
524-
echo $version->getName() . ': ' . $version->getFrozenNode()->getPropertyValue('foo') . "\n"; // 1.0: bar
525-
echo $oldversion->getName() . ': ' . $oldversion->getFrozenNode()->getPropertyValue('foo'); // jcr:rootVersion: fafa
524+
echo $version->getName() . ': ' . $version->getFrozenNode()->getPropertyValue('foo') . "\n"; // 1.1: bar
525+
echo $oldversion->getName() . ': ' . $oldversion->getFrozenNode()->getPropertyValue('foo'); // 1.0: fafa
526526

527527
// get the full version history
528528
$history = $versionManager->getVersionHistory($node->getPath());
529529
foreach ($history->getAllFrozenNodes() as $node) {
530-
echo $node->getPropertyValue('foo');
530+
if ($node->hasProperty('foo')) {
531+
// the root version does not have the property
532+
echo $node->getPropertyValue('foo') . "\n";
533+
}
531534
}
532535

533536
// restore an old version
@@ -715,7 +718,7 @@ In a nutshell:
715718
* for your own things, use nt:unstructured and PHPCR will behave like a NoSQL database
716719
* if you need to store additional properties or children on existing node types like files, note that while a node can have only one primary type, every node can have any mixin types. Define a mixin type declaring your additional properties, register it with PHPCR and addMixin it to the nodes that need it.
717720

718-
You can define your own node types if you want the equivalent of a strictly defined database structure. See [JCR 2.0: 3.7 Node Types](http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.7%20Node%20Types) and [JCR 2.0: 19 Node Type Management](http://www.day.com/specs/jcr/2.0/19_Node_Type_Management.html) / [PHPCR Node Type Namespace](http://phpcr.github.com/doc/html/phpcr/nodetype/package-summary.html).
721+
You can define your own node types if you want the equivalent of a strictly defined database structure. See [JCR 2.0: 3.7 Node Types](http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.7%20Node%20Types) and [JCR 2.0: 19 Node Type Management](http://www.day.com/specs/jcr/2.0/19_Node_Type_Management.html) / [PHPCR Node Type Namespace](http://phpcr.github.io/doc/html/index.html).
719722

720723

721724
## Performance considerations

0 commit comments

Comments
 (0)
Please sign in to comment.