Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
b9f7f07a
Commit
b9f7f07a
authored
Jul 13, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
18115c77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
plugins.txt
manual/new/docs/en/plugins.txt
+42
-0
No files found.
manual/new/docs/en/plugins.txt
View file @
b9f7f07a
...
...
@@ -41,6 +41,48 @@ echo 'Longest query: ' . $longestQuery . "\n";
++ Cache
++ Locking Manager
++ Connection Profiler
++ AuditLog and versioning
Doctrine_AuditLog provides a full versioning solution. Lets say we have a NewsItem class that we want to be versioned. This means that everytime a NewsItem object is updated its version number is increased.
+++ Creating a versioned record
<code type='php'>
class NewsItem extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('title', 'string', 200);
$this->hasColumn('content', 'string');
}
public function setUp()
{
$this->loadTemplate(new Doctrine_AuditLog_Template());
}
}
</code>
+++ Using versioning
<code type='php'>
$newsItem = new NewsItem();
$newsItem->title = 'No news is good news';
$newsItem->content = 'All quiet on the western front';
$newsItem->save();
$newsItem->version; // 1
$newsItem->title = 'A different title';
$newsItem->save();
$newsItem->version; // 2
</code>
<code type='php'>
$newsItem->revert(1);
$newsItem->title; // No news is good news
</code>
++ Hook
++ Soft-delete
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment