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
41bb34ef
Commit
41bb34ef
authored
Jul 20, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
6674d341
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
10 deletions
+31
-10
Record.php
lib/Doctrine/Record.php
+31
-10
No files found.
lib/Doctrine/Record.php
View file @
41bb34ef
...
...
@@ -44,8 +44,8 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
const
STATE_DIRTY
=
1
;
/**
* TDIRTY STATE
* a Doctrine_Record is in transient dirty state when it is created
and some of its fields are modified
* but it is NOT yet persisted into database
* a Doctrine_Record is in transient dirty state when it is created
*
and some of its fields are modified
but it is NOT yet persisted into database
*/
const
STATE_TDIRTY
=
2
;
/**
...
...
@@ -66,7 +66,10 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
const
STATE_TCLEAN
=
5
;
/**
* LOCKED STATE
* a Doctrine_Record is temporarily locked during deletes
* a Doctrine_Record is temporarily locked during deletes and saves
*
* This state is used internally to ensure that circular deletes
* and saves will not cause infinite loops
*/
const
STATE_LOCKED
=
6
;
/**
...
...
@@ -1368,25 +1371,36 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
return
$this
->
_node
;
}
/**
* revert
* reverts this record to given version, this method only works if versioning plugin
* is enabled
*
* @throws Doctrine_Record_Exception if given version does not exist
* @param integer $version an integer > 1
* @return Doctrine_Record this object
*/
public
function
revert
(
$version
)
{
$data
=
$this
->
_table
->
getTemplate
(
'Doctrine_Template_Versionable'
)
->
getAuditLog
()
->
getVersion
(
$this
,
$version
);
if
(
!
isset
(
$data
[
0
]))
{
throw
new
Doctrine_Record_Exception
(
'Version '
.
$version
.
' does not exist!'
);
throw
new
Doctrine_Record_Exception
(
'Version '
.
$version
.
' does not exist!'
);
}
$this
->
_data
=
$data
[
0
];
return
$this
;
}
/**
* loadTemplate
*
* @param string $template
*/
public
function
loadTemplate
(
$template
,
$options
=
array
())
public
function
loadTemplate
(
$template
,
array
$options
=
array
())
{
$tpl
=
new
$template
(
$options
);
$tpl
->
setTable
(
$this
->
_table
);
...
...
@@ -1394,20 +1408,27 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
$tpl
->
setTableDefinition
();
return
$this
;
}
public
function
actAs
(
$tpl
,
$options
=
array
())
/**
* actAs
* loads a given plugin
*
* @param mixed $tpl
* @param array $options
*/
public
function
actAs
(
$tpl
,
array
$options
=
array
())
{
if
(
!
is_object
(
$tpl
))
{
if
(
class_exists
(
$tpl
))
{
if
(
class_exists
(
$tpl
,
true
))
{
$tpl
=
new
$tpl
(
$options
);
}
else
{
$className
=
'Doctrine_Template_'
.
ucwords
(
strtolower
(
$tpl
));
if
(
!
class_exists
(
$className
))
{
if
(
!
class_exists
(
$className
,
true
))
{
throw
new
Doctrine_Record_Exception
(
"Couldn't load plugin."
);
}
$tpl
=
new
$className
(
$options
);
}
}
...
...
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