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
670a961a
Commit
670a961a
authored
Jun 11, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
43af7b69
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
28 deletions
+10
-28
Manager.php
lib/Doctrine/Manager.php
+1
-4
Filter.php
lib/Doctrine/Record/Filter.php
+9
-24
No files found.
lib/Doctrine/Manager.php
View file @
670a961a
...
...
@@ -75,11 +75,8 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
$this
->
_root
=
dirname
(
__FILE__
);
$this
->
_null
=
new
Doctrine_Null
;
Doctrine_Record
::
initNullObject
(
$this
->
_null
);
Doctrine_Collection
::
initNullObject
(
$this
->
_null
);
Doctrine_Record_Iterator
::
initNullObject
(
$this
->
_null
);
Doctrine_Validator
::
initNullObject
(
$this
->
_null
);
Doctrine_Record_Filter
::
initNullObject
(
$this
->
_null
);
Doctrine_Object
::
initNullObject
(
$this
->
_null
);
}
/**
...
...
lib/Doctrine/Record/Filter.php
View file @
670a961a
...
...
@@ -31,17 +31,12 @@
* @since 1.0
* @version $Revision: 1298 $
*/
class
Doctrine_Record_Filter
class
Doctrine_Record_Filter
extends
Doctrine_Object
{
/**
* @var Doctrine_Record $_record the record object this filter belongs to
*/
protected
$_record
;
/**
* @var Doctrine_Null $null a Doctrine_Null object used for extremely fast
* null value testing
*/
private
static
$null
;
/**
* constructor
*
...
...
@@ -60,16 +55,6 @@ class Doctrine_Record_Filter
{
return
$this
->
_record
;
}
/**
* initNullObject
*
* @param Doctrine_Null $null
* @return void
*/
public
static
function
initNullObject
(
Doctrine_Null
$null
)
{
self
::
$null
=
$null
;
}
/**
* setDefaultValues
* sets the default values for records internal data
...
...
@@ -89,10 +74,10 @@ class Doctrine_Record_Filter
$default
=
$table
->
getDefaultValueOf
(
$column
);
if
(
$default
===
null
)
{
$default
=
self
::
$null
;
$default
=
self
::
$
_
null
;
}
if
(
$value
===
self
::
$null
||
$overwrite
)
{
if
(
$value
===
self
::
$
_
null
||
$overwrite
)
{
$this
->
_record
->
rawSet
(
$column
,
$default
);
$modified
[]
=
$column
;
$this
->
_record
->
state
(
Doctrine_Record
::
STATE_TDIRTY
);
...
...
@@ -133,12 +118,12 @@ class Doctrine_Record_Filter
$type
=
$this
->
_record
->
getTable
()
->
getTypeOf
(
$name
);
if
(
!
isset
(
$tmp
[
$name
]))
{
$data
[
$name
]
=
self
::
$null
;
$data
[
$name
]
=
self
::
$
_
null
;
}
else
{
switch
(
$type
)
{
case
'array'
:
case
'object'
:
if
(
$tmp
[
$name
]
!==
self
::
$null
)
{
if
(
$tmp
[
$name
]
!==
self
::
$
_
null
)
{
if
(
is_string
(
$tmp
[
$name
]))
{
$value
=
unserialize
(
$tmp
[
$name
]);
...
...
@@ -152,7 +137,7 @@ class Doctrine_Record_Filter
}
break
;
case
'gzip'
:
if
(
$tmp
[
$name
]
!==
self
::
$null
)
{
if
(
$tmp
[
$name
]
!==
self
::
$
_
null
)
{
$value
=
gzuncompress
(
$tmp
[
$name
]);
if
(
$value
===
false
)
{
...
...
@@ -186,14 +171,14 @@ class Doctrine_Record_Filter
$this
->
_id
=
array
();
if
(
count
(
$id
)
>
1
)
{
foreach
(
$id
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
];
}
}
}
else
{
if
(
isset
(
$this
->
_data
[
$id
])
&&
$this
->
_data
[
$id
]
!==
self
::
$null
)
{
if
(
isset
(
$this
->
_data
[
$id
])
&&
$this
->
_data
[
$id
]
!==
self
::
$
_
null
)
{
$this
->
_id
[
$id
]
=
$this
->
_data
[
$id
];
}
}
...
...
@@ -216,7 +201,7 @@ class Doctrine_Record_Filter
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