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
22753f19
Commit
22753f19
authored
May 18, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
62e7ba76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
Record.php
lib/Doctrine/Record.php
+24
-24
No files found.
lib/Doctrine/Record.php
View file @
22753f19
...
...
@@ -118,16 +118,16 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
/**
* @var integer $index this index is used for creating object identifiers
*/
private
static
$
index
=
1
;
private
static
$
_index
=
1
;
/**
* @var Doctrine_Null $null a Doctrine_Null object used for extremely fast
* null value testing
*/
private
static
$null
;
private
static
$
_
null
;
/**
* @var integer $oid object identifier, each Record object has a unique object identifier
*/
private
$oid
;
private
$
_
oid
;
/**
* constructor
...
...
@@ -162,9 +162,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
// relations.
if
(
$this
->
_table
->
getConnection
()
->
hasTable
(
$this
->
_table
->
getComponentName
()))
{
$this
->
oid
=
self
::
$
index
;
$this
->
_oid
=
self
::
$_
index
;
self
::
$index
++
;
self
::
$
_
index
++
;
$keys
=
$this
->
_table
->
getPrimaryKeys
();
...
...
@@ -226,14 +226,14 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
public
static
function
initNullObject
(
Doctrine_Null
$null
)
{
self
::
$null
=
$null
;
self
::
$
_
null
=
$null
;
}
/**
* @return Doctrine_Null
*/
public
static
function
getNullObject
()
{
return
self
::
$null
;
return
self
::
$
_
null
;
}
/**
* setUp
...
...
@@ -254,14 +254,14 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
public
function
construct
()
{
}
/**
* getO
ID
* getO
id
* returns the object identifier
*
* @return integer
*/
public
function
getO
ID
()
public
function
getO
id
()
{
return
$this
->
oid
;
return
$this
->
_
oid
;
}
/**
* isValid
...
...
@@ -352,9 +352,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$default
=
$this
->
_table
->
getDefaultValueOf
(
$column
);
if
(
$default
===
null
)
$default
=
self
::
$null
;
$default
=
self
::
$
_
null
;
if
(
$value
===
self
::
$null
||
$overwrite
)
{
if
(
$value
===
self
::
$
_
null
||
$overwrite
)
{
$this
->
_data
[
$column
]
=
$default
;
$this
->
_modified
[]
=
$column
;
$this
->
_state
=
Doctrine_Record
::
STATE_TDIRTY
;
...
...
@@ -391,7 +391,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$name
=
$this
->
_table
->
getIdentifier
();
if
(
$exists
)
{
if
(
isset
(
$this
->
_data
[
$name
])
&&
$this
->
_data
[
$name
]
!==
self
::
$null
)
{
if
(
isset
(
$this
->
_data
[
$name
])
&&
$this
->
_data
[
$name
]
!==
self
::
$
_
null
)
{
$this
->
_id
[
$name
]
=
$this
->
_data
[
$name
];
}
}
...
...
@@ -403,7 +403,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$this
->
_id
=
array
();
$name
=
$this
->
_table
->
getIdentifier
();
if
(
isset
(
$this
->
_data
[
$name
])
&&
$this
->
_data
[
$name
]
!==
self
::
$null
)
{
if
(
isset
(
$this
->
_data
[
$name
])
&&
$this
->
_data
[
$name
]
!==
self
::
$
_
null
)
{
$this
->
_id
[
$name
]
=
$this
->
_data
[
$name
];
}
break
;
...
...
@@ -411,7 +411,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$names
=
$this
->
_table
->
getIdentifier
();
foreach
(
$names
as
$name
)
{
if
(
$this
->
_data
[
$name
]
===
self
::
$null
)
{
if
(
$this
->
_data
[
$name
]
===
self
::
$
_
null
)
{
$this
->
_id
[
$name
]
=
null
;
}
else
{
$this
->
_id
[
$name
]
=
$this
->
_data
[
$name
];
...
...
@@ -443,7 +443,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
foreach
(
$this
->
_data
as
$k
=>
$v
)
{
if
(
$v
instanceof
Doctrine_Record
)
{
unset
(
$vars
[
'_data'
][
$k
]);
}
elseif
(
$v
===
self
::
$null
)
{
}
elseif
(
$v
===
self
::
$
_
null
)
{
unset
(
$vars
[
'_data'
][
$k
]);
}
else
{
switch
(
$this
->
_table
->
getTypeOf
(
$k
))
{
...
...
@@ -647,7 +647,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
if
(
!
isset
(
$this
->
_data
[
$name
]))
{
throw
new
Doctrine_Record_Exception
(
'Unknown property '
.
$name
);
}
if
(
$this
->
_data
[
$name
]
===
self
::
$null
)
if
(
$this
->
_data
[
$name
]
===
self
::
$
_
null
)
return
null
;
return
$this
->
_data
[
$name
];
...
...
@@ -682,18 +682,18 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
public
function
get
(
$name
,
$invoke
=
true
)
{
$value
=
self
::
$null
;
$value
=
self
::
$
_
null
;
$lower
=
strtolower
(
$name
);
$lower
=
$this
->
_table
->
getColumnName
(
$lower
);
if
(
isset
(
$this
->
_data
[
$lower
]))
{
// check if the property is null (= it is the Doctrine_Null object located in self::$null)
if
(
$this
->
_data
[
$lower
]
===
self
::
$null
)
{
// check if the property is null (= it is the Doctrine_Null object located in self::$
_
null)
if
(
$this
->
_data
[
$lower
]
===
self
::
$
_
null
)
{
$this
->
load
();
}
if
(
$this
->
_data
[
$lower
]
===
self
::
$null
)
{
if
(
$this
->
_data
[
$lower
]
===
self
::
$
_
null
)
{
$value
=
null
;
}
else
{
$value
=
$this
->
_data
[
$lower
];
...
...
@@ -701,7 +701,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
if
(
$value
!==
self
::
$null
)
{
if
(
$value
!==
self
::
$
_
null
)
{
$value
=
$this
->
_table
->
invokeGet
(
$this
,
$name
,
$value
);
if
(
$invoke
&&
$name
!==
$this
->
_table
->
getIdentifier
())
{
...
...
@@ -787,7 +787,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$value
=
$this
->
_table
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onSetProperty
(
$this
,
$name
,
$value
);
if
(
$value
===
null
)
$value
=
self
::
$null
;
$value
=
self
::
$
_
null
;
$this
->
_data
[
$lower
]
=
$value
;
$this
->
_modified
[]
=
$lower
;
...
...
@@ -991,7 +991,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
foreach
(
$array
as
$k
=>
$v
)
{
$type
=
$this
->
_table
->
getTypeOf
(
$v
);
if
(
$this
->
_data
[
$v
]
===
self
::
$null
)
{
if
(
$this
->
_data
[
$v
]
===
self
::
$
_
null
)
{
$a
[
$v
]
=
null
;
continue
;
}
...
...
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