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
5d1d506a
Commit
5d1d506a
authored
Sep 01, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added invoker catching
parent
96f97c24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
Record.php
lib/Doctrine/Record.php
+2
-0
Template.php
lib/Doctrine/Template.php
+28
-4
No files found.
lib/Doctrine/Record.php
View file @
5d1d506a
...
...
@@ -1503,6 +1503,8 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
{
foreach
(
$this
->
_table
->
getTemplates
()
as
$template
)
{
if
(
method_exists
(
$template
,
$method
))
{
$template
->
setInvoker
(
$this
);
return
call_user_func_array
(
array
(
$template
,
$method
),
$args
);
}
}
...
...
lib/Doctrine/Template.php
View file @
5d1d506a
...
...
@@ -32,11 +32,14 @@ Doctrine::autoload('Doctrine_Record_Abstract');
*/
class
Doctrine_Template
extends
Doctrine_Record_Abstract
{
/**
* @param Doctrine_Record $_invoker the record that invoked the last delegated call
*/
protected
$_invoker
;
/**
* setTable
*
* @param Doctrine_Table $_table the table object this Template belongs to
* @param Doctrine_Table $_table
the table object this Template belongs to
*/
public
function
setTable
(
Doctrine_Table
$table
)
{
...
...
@@ -46,13 +49,34 @@ class Doctrine_Template extends Doctrine_Record_Abstract
* getTable
* returns the associated table object
*
* @return Doctrine_Table the associated table object
* @return Doctrine_Table
the associated table object
*/
public
function
getTable
()
{
return
$this
->
_table
;
}
/**
* setInvoker
*
* sets the last used invoker
*
* @param Doctrine_Record $invoker the record that invoked the last delegated call
* @return Doctrine_Template this object
*/
public
function
setInvoker
(
Doctrine_Record
$invoker
)
{
$this
->
_invoker
=
$invoker
;
}
/**
* setInvoker
* returns the last used invoker
*
* @return Doctrine_Record the record that invoked the last delegated call
*/
public
function
getInvoker
()
{
return
$this
->
_invoker
;
}
public
function
setUp
()
{
...
...
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