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
0c0e6fd6
Commit
0c0e6fd6
authored
Oct 23, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added Doctrine_Record::state()
parent
7e7a0b87
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
3 deletions
+88
-3
Record.php
lib/Doctrine/Record.php
+32
-0
Exception.php
lib/Doctrine/Record/Exception.php
+27
-3
Exception.php
lib/Doctrine/Record/State/Exception.php
+29
-0
No files found.
lib/Doctrine/Record.php
View file @
0c0e6fd6
...
...
@@ -499,6 +499,38 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
final
public
function
getState
()
{
return
$this
->
_state
;
}
/**
* state
* returns / assigns the state of this record
*
* @param integer|string $state if set, this method tries to set the record state to $state
*
* @throws Doctrine_Record_State_Exception if trying to set an unknown state
* @return null|integer
*/
public
function
state
(
$state
=
null
)
{
if
(
$state
==
null
)
{
return
$this
->
_state
;
}
if
(
is_integer
(
$state
))
{
if
(
$state
>=
1
&&
$state
<=
6
)
$this
->
_state
=
$state
;
}
elseif
(
is_string
(
$state
))
{
$upper
=
strtoupper
(
$state
);
switch
(
$upper
)
{
case
'DIRTY'
:
case
'CLEAN'
:
case
'TDIRTY'
:
case
'TCLEAN'
:
case
'PROXY'
:
case
'DELETED'
:
$this
->
_state
=
constant
(
'Doctrine_Record::STATE_'
.
$upper
);
break
;
}
}
throw
new
Doctrine_Record_State_Exception
(
'Unknown record state '
.
$state
);
}
/**
* refresh
* refresh internal data from the database
...
...
lib/Doctrine/Record/Exception.php
View file @
0c0e6fd6
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine
::
autoload
(
'Doctrine_Exception'
);
class
Doctrine_Record_Exception
extends
Doctrine_Exception
{
}
/**
* Doctrine_Exception
*
* @package Doctrine ORM
* @url www.phpdoctrine.com
* @license LGPL
*/
class
Doctrine_Record_Exception
extends
Doctrine_Exception
{
}
lib/Doctrine/Record/State/Exception.php
0 → 100644
View file @
0c0e6fd6
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine
::
autoload
(
'Doctrine_Record_Exception'
);
/**
* Doctrine_Exception
*
* @package Doctrine ORM
* @url www.phpdoctrine.com
* @license LGPL
*/
class
Doctrine_Record_State_Exception
extends
Doctrine_Record_Exception
{
}
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