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
1b3e9817
Commit
1b3e9817
authored
May 16, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
33bb25ac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
Manager.php
lib/Doctrine/Manager.php
+1
-0
Filter.php
lib/Doctrine/Record/Filter.php
+40
-0
No files found.
lib/Doctrine/Manager.php
View file @
1b3e9817
...
...
@@ -79,6 +79,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
Doctrine_Collection
::
initNullObject
(
$this
->
null
);
Doctrine_Record_Iterator
::
initNullObject
(
$this
->
null
);
Doctrine_Validator
::
initNullObject
(
$this
->
null
);
Doctrine_Record_Filter
::
initNullOjbect
(
$this
->
null
);
}
/**
* @return Doctrine_Null
...
...
lib/Doctrine/Record/Filter.php
View file @
1b3e9817
...
...
@@ -55,6 +55,46 @@ 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
*
* @param boolean $overwrite whether or not to overwrite the already set values
* @return boolean
*/
public
function
assignDefaultValues
(
$data
,
$overwrite
=
false
)
{
$table
=
$this
->
_record
->
getTable
();
if
(
!
$table
->
hasDefaultValues
())
{
return
false
;
}
$modified
=
array
();
foreach
(
$data
as
$column
=>
$value
)
{
$default
=
$table
->
getDefaultValueOf
(
$column
);
if
(
$default
===
null
)
{
$default
=
self
::
$null
;
}
if
(
$value
===
self
::
$null
||
$overwrite
)
{
$this
->
_record
->
rawSet
(
$column
,
$default
);
$modified
[]
=
$column
;
$this
->
_record
->
state
(
Doctrine_Record
::
STATE_TDIRTY
);
}
}
$this
->
_record
->
setModified
(
$modified
);
}
/**
* cleanData
* this method does several things to records internal data
...
...
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