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
9ea8d5da
Commit
9ea8d5da
authored
May 10, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
b3cf15a1
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
267 deletions
+24
-267
Collection.php
draft/new-core/Collection.php
+16
-189
Record.php
draft/new-core/Record.php
+8
-78
No files found.
draft/new-core/Collection.php
View file @
9ea8d5da
This diff is collapsed.
Click to expand it.
draft/new-core/Record.php
View file @
9ea8d5da
...
...
@@ -111,10 +111,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
* @var array $references an array containing all the references
*/
private
$references
=
array
();
/**
* @var array $originals an array containing all the original references
*/
private
$originals
=
array
();
/**
* @var integer $index this index is used for creating object identifiers
*/
...
...
@@ -611,9 +607,10 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
}
if
(
$err
)
if
(
$err
)
{
throw
new
Doctrine_Record_State_Exception
(
'Unknown record state '
.
$state
);
}
}
/**
* refresh
* refresh internal data from the database
...
...
@@ -622,7 +619,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
* this record represents does not exist anymore)
* @return boolean
*/
final
public
function
refresh
()
public
function
refresh
()
{
$id
=
$this
->
obtainIdentifier
();
if
(
!
is_array
(
$id
))
{
...
...
@@ -661,7 +658,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
* @throws Doctrine_Record_Exception When the primary key of this record doesn't match the primary key fetched from a collection
* @return void
*/
final
public
function
factoryRefresh
()
public
function
factoryRefresh
()
{
$this
->
_data
=
$this
->
_table
->
getData
();
$old
=
$this
->
_id
;
...
...
@@ -670,8 +667,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$this
->
prepareIdentifiers
();
if
(
$this
->
_id
!=
$old
)
if
(
$this
->
_id
!=
$old
)
{
throw
new
Doctrine_Record_Exception
(
"The refreshed primary key doesn't match the one in the record memory."
,
Doctrine
::
ERR_REFRESH
);
}
$this
->
_state
=
Doctrine_Record
::
STATE_CLEAN
;
$this
->
_modified
=
array
();
...
...
@@ -684,7 +682,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*
* @return object Doctrine_Table a Doctrine_Table object
*/
final
public
function
getTable
()
public
function
getTable
()
{
return
$this
->
_table
;
}
...
...
@@ -694,7 +692,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*
* @return array an array containing all the properties
*/
final
public
function
getData
()
public
function
getData
()
{
return
$this
->
_data
;
}
...
...
@@ -707,7 +705,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
* @throws Doctrine_Record_Exception if trying to get an unknown property
* @return mixed
*/
public
function
rawGet
(
$name
)
{
if
(
!
isset
(
$this
->
_data
[
$name
]))
{
...
...
@@ -718,7 +715,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
return
$this
->
_data
[
$name
];
}
/**
* load
* loads all the unitialized properties from the database
...
...
@@ -1164,19 +1160,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
{
return
new
Doctrine_Record_Iterator
(
$this
);
}
/**
* getOriginals
* returns an original collection of related component
*
* @return Doctrine_Collection|false
*/
public
function
obtainOriginals
(
$name
)
{
if
(
isset
(
$this
->
originals
[
$name
]))
{
return
$this
->
originals
[
$name
];
}
return
false
;
}
/**
* deletes this data access object and all the related composites
* this operation is isolated by a transaction
...
...
@@ -1255,17 +1238,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$this
->
_modified
=
array
();
}
}
/**
* assignOriginals
*
* @param string $alias
* @param Doctrine_Collection $coll
* @return void
*/
public
function
assignOriginals
(
$alias
,
Doctrine_Collection
$coll
)
{
$this
->
originals
[
$alias
]
=
$coll
;
}
/**
* returns the primary keys of this object
*
...
...
@@ -1347,24 +1319,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
return
false
;
}
public
function
lazyInitRelated
(
Doctrine_Collection
$coll
,
Doctrine_Relation
$connector
)
{
}
/**
* addReference
* @param Doctrine_Record $record
* @param mixed $key
* @return void
*/
public
function
addReference
(
Doctrine_Record
$record
,
Doctrine_Relation
$connector
,
$key
=
null
)
{
$alias
=
$connector
->
getAlias
();
$this
->
references
[
$alias
]
->
add
(
$record
,
$key
);
$this
->
originals
[
$alias
]
->
add
(
$record
,
$key
);
}
/**
* getReferences
* @return array all references
...
...
@@ -1373,17 +1327,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
{
return
$this
->
references
;
}
/**
* setRelated
*
* @param string $alias
* @param Doctrine_Access $coll
*/
final
public
function
setRelated
(
$alias
,
Doctrine_Access
$coll
)
{
$this
->
references
[
$alias
]
=
$coll
;
$this
->
originals
[
$alias
]
=
$coll
;
}
/**
* loadReference
* loads a related component
...
...
@@ -1394,7 +1337,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
*/
final
public
function
loadReference
(
$name
)
{
$fk
=
$this
->
_table
->
getRelation
(
$name
);
if
(
$fk
->
isOneToOne
())
{
...
...
@@ -1404,7 +1346,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$coll
=
$fk
->
fetchRelatedFor
(
$this
);
$this
->
references
[
$name
]
=
$coll
;
$this
->
originals
[
$name
]
=
clone
$coll
;
}
}
/**
...
...
@@ -1562,17 +1503,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$this
->
_table
->
setOption
(
$name
,
$value
);
}
}
/**
* index
* defines a foreignKey
*
* @param array $definition the definition array
* @return void
*/
public
function
foreignKey
(
array
$definition
=
array
())
{
return
$this
->
_table
->
addForeignKey
(
$definition
);
}
/**
* index
* defines or retrieves an index
...
...
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