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
716bcedd
Commit
716bcedd
authored
Dec 30, 2007
by
hartym
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem on Sluggable Listener default values merging
parent
7d6e9b29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Sluggable.php
lib/Doctrine/Template/Listener/Sluggable.php
+4
-4
Sluggable.php
lib/Doctrine/Template/Sluggable.php
+4
-4
No files found.
lib/Doctrine/Template/Listener/Sluggable.php
View file @
716bcedd
...
@@ -44,7 +44,7 @@ class Doctrine_Template_Listener_Sluggable extends Doctrine_Record_Listener
...
@@ -44,7 +44,7 @@ class Doctrine_Template_Listener_Sluggable extends Doctrine_Record_Listener
'length'
=>
null
,
'length'
=>
null
,
'options'
=>
array
(),
'options'
=>
array
(),
'fields'
=>
array
());
'fields'
=>
array
());
/**
/**
* __construct
* __construct
*
*
...
@@ -53,7 +53,7 @@ class Doctrine_Template_Listener_Sluggable extends Doctrine_Record_Listener
...
@@ -53,7 +53,7 @@ class Doctrine_Template_Listener_Sluggable extends Doctrine_Record_Listener
*/
*/
public
function
__construct
(
array
$options
)
public
function
__construct
(
array
$options
)
{
{
$this
->
_options
=
array_merge
(
$options
,
$this
->
_
options
);
$this
->
_options
=
Doctrine_Lib
::
arrayDeepMerge
(
$this
->
_options
,
$
options
);
}
}
public
function
preInsert
(
Doctrine_Event
$event
)
public
function
preInsert
(
Doctrine_Event
$event
)
...
@@ -61,7 +61,7 @@ class Doctrine_Template_Listener_Sluggable extends Doctrine_Record_Listener
...
@@ -61,7 +61,7 @@ class Doctrine_Template_Listener_Sluggable extends Doctrine_Record_Listener
$name
=
$this
->
_options
[
'name'
];
$name
=
$this
->
_options
[
'name'
];
$record
=
$event
->
getInvoker
();
$record
=
$event
->
getInvoker
();
if
(
!
$record
->
$name
)
{
if
(
!
$record
->
$name
)
{
$record
->
$name
=
$this
->
buildSlug
(
$record
);
$record
->
$name
=
$this
->
buildSlug
(
$record
);
}
}
...
@@ -80,4 +80,4 @@ class Doctrine_Template_Listener_Sluggable extends Doctrine_Record_Listener
...
@@ -80,4 +80,4 @@ class Doctrine_Template_Listener_Sluggable extends Doctrine_Record_Listener
return
Doctrine_Inflector
::
urlize
(
$value
);
return
Doctrine_Inflector
::
urlize
(
$value
);
}
}
}
}
\ No newline at end of file
lib/Doctrine/Template/Sluggable.php
View file @
716bcedd
...
@@ -44,7 +44,7 @@ class Doctrine_Template_Sluggable extends Doctrine_Template
...
@@ -44,7 +44,7 @@ class Doctrine_Template_Sluggable extends Doctrine_Template
'length'
=>
null
,
'length'
=>
null
,
'options'
=>
array
(),
'options'
=>
array
(),
'fields'
=>
array
());
'fields'
=>
array
());
/**
/**
* __construct
* __construct
*
*
...
@@ -55,7 +55,7 @@ class Doctrine_Template_Sluggable extends Doctrine_Template
...
@@ -55,7 +55,7 @@ class Doctrine_Template_Sluggable extends Doctrine_Template
{
{
$this
->
_options
=
Doctrine_Lib
::
arrayDeepMerge
(
$this
->
_options
,
$options
);
$this
->
_options
=
Doctrine_Lib
::
arrayDeepMerge
(
$this
->
_options
,
$options
);
}
}
/**
/**
* setTableDefinition
* setTableDefinition
*
*
...
@@ -64,7 +64,7 @@ class Doctrine_Template_Sluggable extends Doctrine_Template
...
@@ -64,7 +64,7 @@ class Doctrine_Template_Sluggable extends Doctrine_Template
public
function
setTableDefinition
()
public
function
setTableDefinition
()
{
{
$this
->
hasColumn
(
$this
->
_options
[
'name'
],
$this
->
_options
[
'type'
],
$this
->
_options
[
'length'
],
$this
->
_options
[
'options'
]);
$this
->
hasColumn
(
$this
->
_options
[
'name'
],
$this
->
_options
[
'type'
],
$this
->
_options
[
'length'
],
$this
->
_options
[
'options'
]);
$this
->
addListener
(
new
Doctrine_Template_Listener_Sluggable
(
$this
->
_options
));
$this
->
addListener
(
new
Doctrine_Template_Listener_Sluggable
(
$this
->
_options
));
}
}
}
}
\ No newline at end of file
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