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
39bfb030
Commit
39bfb030
authored
Oct 14, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
0f79ed1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
Search.php
lib/Doctrine/Search.php
+24
-3
No files found.
lib/Doctrine/Search.php
View file @
39bfb030
...
...
@@ -32,11 +32,16 @@
*/
class
Doctrine_Search
extends
Doctrine_Plugin
{
const
INDEX_FILES
=
0
;
const
INDEX_TABLE
=
1
;
protected
$_options
=
array
(
'generateFiles'
=>
false
,
'className'
=>
'%CLASS%Index'
,
'generatePath'
=>
false
,
'batchUpdates'
=>
false
,
'pluginTable'
=>
false
);
'pluginTable'
=>
false
,
'fields'
=>
array
());
public
function
__construct
(
array
$options
)
...
...
@@ -97,6 +102,12 @@ class Doctrine_Search extends Doctrine_Plugin
}
}
public
function
readTableData
(
$limit
=
null
,
$offset
=
null
)
{
}
public
function
processPending
(
$limit
=
null
,
$offset
=
null
)
{
$conn
=
$this
->
_options
[
'ownerTable'
]
->
getConnection
();
...
...
@@ -115,9 +126,19 @@ class Doctrine_Search extends Doctrine_Plugin
.
' IN (SELECT '
.
$conn
->
quoteIdentifier
(
$id
)
.
' FROM '
.
$conn
->
quoteIdentifier
(
$this
->
_options
[
'pluginTable'
]
->
getTableName
())
.
' WHERE keyword IS NULL)'
;
$query
=
$conn
->
modifyLimitQuery
(
$query
,
$limit
,
$offset
);
$rows
=
$conn
->
fetchAll
(
$query
);
foreach
(
$rows
as
$row
)
{
$ids
[]
=
$row
[
$id
];
}
$conn
->
exec
(
'DELETE FROM '
.
$conn
->
quoteIdentifier
(
$this
->
_options
[
'pluginTable'
]
->
getTableName
())
.
' WHERE '
.
$conn
->
quoteIdentifier
(
$id
)
.
' IN ('
.
implode
(
', '
,
$ids
)
.
')'
);
foreach
(
$rows
as
$row
)
{
foreach
(
$fields
as
$field
)
{
$data
=
$row
[
$field
];
...
...
@@ -131,8 +152,8 @@ class Doctrine_Search extends Doctrine_Plugin
$index
->
position
=
$pos
;
$index
->
field
=
$field
;
foreach
((
array
)
$
this
->
_options
[
'ownerTable'
]
->
getIdentifier
()
as
$id
)
{
$index
->
$id
=
$row
[
$id
];
foreach
((
array
)
$
id
as
$identifier
)
{
$index
->
$id
entifier
=
$row
[
$identifier
];
}
$index
->
save
();
...
...
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