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
90bf6241
Commit
90bf6241
authored
Aug 03, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
da1a6e38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
51 deletions
+52
-51
Record.php
lib/Doctrine/Record.php
+0
-50
Abstract.php
lib/Doctrine/Record/Abstract.php
+52
-1
No files found.
lib/Doctrine/Record.php
View file @
90bf6241
...
...
@@ -1403,57 +1403,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
return
$this
;
}
/**
* loadTemplate
*
* @param string $template
*/
public
function
loadTemplate
(
$template
,
array
$options
=
array
())
{
$tpl
=
new
$template
(
$options
);
$tpl
->
setTable
(
$this
->
_table
);
$tpl
->
setUp
();
$tpl
->
setTableDefinition
();
return
$this
;
}
/**
* actAs
* loads a given plugin
*
* @param mixed $tpl
* @param array $options
*/
public
function
actAs
(
$tpl
,
array
$options
=
array
())
{
if
(
!
is_object
(
$tpl
))
{
if
(
class_exists
(
$tpl
,
true
))
{
$tpl
=
new
$tpl
(
$options
);
}
else
{
$className
=
'Doctrine_Template_'
.
ucwords
(
strtolower
(
$tpl
));
if
(
!
class_exists
(
$className
,
true
))
{
throw
new
Doctrine_Record_Exception
(
"Couldn't load plugin."
);
}
$tpl
=
new
$className
(
$options
);
}
}
if
(
!
(
$tpl
instanceof
Doctrine_Template
))
{
throw
new
Doctrine_Record_Exception
(
'Loaded plugin class is not an istance of Doctrine_Template.'
);
}
$className
=
get_class
(
$tpl
);
$this
->
_table
->
addTemplate
(
$className
,
$tpl
);
$tpl
->
setTable
(
$this
->
_table
);
$tpl
->
setUp
();
$tpl
->
setTableDefinition
();
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 @
90bf6241
...
...
@@ -234,7 +234,58 @@ abstract class Doctrine_Record_Abstract extends Doctrine_Access
foreach
(
$definitions
as
$name
=>
$options
)
{
$this
->
hasColumn
(
$name
,
$options
[
'type'
],
$options
[
'length'
],
$options
);
}
}
}
/**
* loadTemplate
*
* @param string $template
*/
public
function
loadTemplate
(
$template
,
array
$options
=
array
())
{
$tpl
=
new
$template
(
$options
);
$tpl
->
setTable
(
$this
->
_table
);
$tpl
->
setUp
();
$tpl
->
setTableDefinition
();
return
$this
;
}
/**
* actAs
* loads a given plugin
*
* @param mixed $tpl
* @param array $options
*/
public
function
actAs
(
$tpl
,
array
$options
=
array
())
{
if
(
!
is_object
(
$tpl
))
{
if
(
class_exists
(
$tpl
,
true
))
{
$tpl
=
new
$tpl
(
$options
);
}
else
{
$className
=
'Doctrine_Template_'
.
ucwords
(
strtolower
(
$tpl
));
if
(
!
class_exists
(
$className
,
true
))
{
throw
new
Doctrine_Record_Exception
(
"Couldn't load plugin."
);
}
$tpl
=
new
$className
(
$options
);
}
}
if
(
!
(
$tpl
instanceof
Doctrine_Template
))
{
throw
new
Doctrine_Record_Exception
(
'Loaded plugin class is not an istance of Doctrine_Template.'
);
}
$className
=
get_class
(
$tpl
);
$this
->
_table
->
addTemplate
(
$className
,
$tpl
);
$tpl
->
setTable
(
$this
->
_table
);
$tpl
->
setUp
();
$tpl
->
setTableDefinition
();
return
$this
;
}
/**
* check
* adds a check constraint
...
...
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