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
da1a6e38
Commit
da1a6e38
authored
Aug 03, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
ab76c18f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
23 deletions
+23
-23
Record.php
lib/Doctrine/Record.php
+0
-20
Abstract.php
lib/Doctrine/Record/Abstract.php
+23
-3
No files found.
lib/Doctrine/Record.php
View file @
da1a6e38
...
...
@@ -1454,26 +1454,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
return
$this
;
}
/**
* check
* adds a check constraint
*
* @param mixed $constraint either a SQL constraint portion or an array of CHECK constraints
* @param string $name optional constraint name
* @return Doctrine_Record this object
*/
public
function
check
(
$constraint
,
$name
=
null
)
{
if
(
is_array
(
$constraint
))
{
foreach
(
$constraint
as
$name
=>
$def
)
{
$this
->
_table
->
addCheckConstraint
(
$def
,
$name
);
}
}
else
{
$this
->
_table
->
addCheckConstraint
(
$constraint
,
$name
);
}
return
$this
;
}
/**
* used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
*
...
...
lib/Doctrine/Record/Abstract.php
View file @
da1a6e38
...
...
@@ -96,14 +96,15 @@ abstract class Doctrine_Record_Abstract extends Doctrine_Access
$this
->
_table
->
setOption
(
'inheritanceMap'
,
$map
);
}
public
function
setSubclasses
(
$map
){
if
(
isset
(
$map
[
get_class
(
$this
)])){
public
function
setSubclasses
(
$map
)
{
if
(
isset
(
$map
[
get_class
(
$this
)])){
$this
->
_table
->
setOption
(
'inheritanceMap'
,
$map
[
get_class
(
$this
)]);
return
;
}
$this
->
_table
->
setOption
(
'subclasses'
,
array_keys
(
$map
));
$conn
=
$this
->
_table
->
getConnection
();
foreach
(
$map
as
$key
=>
$value
)
{
foreach
(
$map
as
$key
=>
$value
)
{
$table
=
$conn
->
getTable
(
$key
);
// $table->setOption('inheritanceMap', $value);
}
...
...
@@ -234,4 +235,23 @@ abstract class Doctrine_Record_Abstract extends Doctrine_Access
$this
->
hasColumn
(
$name
,
$options
[
'type'
],
$options
[
'length'
],
$options
);
}
}
/**
* check
* adds a check constraint
*
* @param mixed $constraint either a SQL constraint portion or an array of CHECK constraints
* @param string $name optional constraint name
* @return Doctrine_Record this object
*/
public
function
check
(
$constraint
,
$name
=
null
)
{
if
(
is_array
(
$constraint
))
{
foreach
(
$constraint
as
$name
=>
$def
)
{
$this
->
_table
->
addCheckConstraint
(
$def
,
$name
);
}
}
else
{
$this
->
_table
->
addCheckConstraint
(
$constraint
,
$name
);
}
return
$this
;
}
}
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