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
999e03fd
Commit
999e03fd
authored
Sep 29, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
526f31bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
Search.php
lib/Doctrine/Search.php
+34
-4
No files found.
lib/Doctrine/Search.php
View file @
999e03fd
...
@@ -95,19 +95,49 @@ class Doctrine_Search
...
@@ -95,19 +95,49 @@ class Doctrine_Search
}
}
}
}
}
}
public
function
processPendingTable
(
$tableName
,
$indexTableName
,
array
$fields
,
$id
,
$conn
=
null
)
{
if
(
!
(
$conn
instanceof
Doctrine_Connection
))
{
$conn
=
Doctrine_Manager
::
connection
();
}
$fields
=
array_merge
(
$fields
,
array
(
$id
));
$query
=
'SELECT '
.
implode
(
', '
,
$fields
)
.
' FROM '
.
$tableName
.
' WHERE '
.
$id
.
' IN (SELECT foreign_id FROM '
.
$indexTableName
.
') ORDER BY '
.
$id
;
$data
=
$conn
->
fetchAll
(
$query
);
foreach
(
$data
as
$row
)
{
$identifier
=
$row
[
$id
];
unset
(
$row
[
$id
]);
foreach
(
$row
as
$field
=>
$data
)
{
$terms
=
$this
->
analyze
(
$data
);
foreach
(
$terms
as
$pos
=>
$term
)
{
$conn
->
insert
(
$indexTableName
,
array
(
'keyword'
=>
$field
,
'position'
=>
$pos
,
'field'
=>
$field
,
'foreign_id'
=>
$identifier
);
}
}
}
}
/**
/**
*
save
Pending
*
insert
Pending
*
*
* @param Doctrine_Record $record
* @return integer
* @return integer
*/
*/
public
function
savePending
(
$t
ableName
,
$id
,
$conn
=
null
)
public
function
insertPending
(
$indexT
ableName
,
$id
,
$conn
=
null
)
{
{
if
(
!
(
$conn
instanceof
Doctrine_Connection
))
{
if
(
!
(
$conn
instanceof
Doctrine_Connection
))
{
$conn
=
Doctrine_Manager
::
connection
();
$conn
=
Doctrine_Manager
::
connection
();
}
}
$conn
->
insert
(
$
t
ableName
,
array
(
'foreign_id'
=>
$id
));
$conn
->
insert
(
$
indexT
ableName
,
array
(
'foreign_id'
=>
$id
));
}
}
public
function
buildDefinition
(
Doctrine_Table
$table
)
public
function
buildDefinition
(
Doctrine_Table
$table
)
{
{
...
...
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