array( "Name" => "Name", "Value" => "Value", "Source" => "Source", "TypeId" => "TypeId", "ParentRevisionId" => "ParentRevisionId", "FirstRevisionId" => "FirstRevisionId", "NodeId" => "NodeId", "RelationshipId" => "RelationshipId" ), 'numeric' => array( "UserId" => "UserId", "Reliability" => "Reliability" ), 'timestamp' => array( "CreationDate" => "CreationDate" ), 'boolean' => array( "LatestRevision" => "LatestRevision" ), 'propertytype' => array( "Type" => "TypeId" ), 'property' => array( "ParentRevision" => "ParentRevisionId", "FirstRevision" => "FirstRevisionId" ), 'node' => array( "Node" => "NodeId" ), 'relationship' => array( "Relationship" => "RelationshipId" ), 'user' => array( "User" => "UserId" ) ); public function SaveRevision($user) { /* Create a working copy of the current object */ $this_copy = clone $this; /* Create a new object representing the new revision */ $sNode = clone $this; $sNode->sId = 0; $sNode->uParentRevisionId = $this->sId; $sNode->uUserId = $user->sId; $sNode->uCreationDate = time(); $sNode->InsertIntoDatabase(true); /* Clear out all changes to the working copy, and save the changed 'latest revision' flag */ $this_copy->RefreshData(); $this_copy->uLatestRevision = false; $this_copy->InsertIntoDatabase(); /* Set the same flag on the current object, in case of further operations */ $this->uLatestRevision = false; } }