Indefero

Indefero Commit Details


Date:2008-11-23 04:26:17 (16 years 29 days ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:78bc9a5466a0eaa2b3d1d1b976f76ff9aa668a2d
Parents: b03422fc18f60240b8028306111db88439f1d2a4
Message:Remove from the index on delete.

Changes:

File differences

src/IDF/Search.php
160160
161161
162162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
163190
}
return array('total' => $total, 'new' => $new_words, 'unique'=>$n);
}
/**
* Remove an item from the index.
*
* You must call this function when you delete items wich are
* indexed. Just add the call:
*
* IDF_Search::remove($this);
*
* in the preDelete() method of your object.
*
* @param mixed Item to be removed
* @return bool Success
*/
public static function remove($item)
{
if ($item->id > 0) {
$sql = new Pluf_SQL('model_id=%s AND model_class=%s',
array($item->id, $item->_model));
$items = Pluf::factory('IDF_Search_Occ')->getList(array('filter'=>$sql->gen()));
foreach ($items as $tl) {
$tl->delete();
}
}
return true;
}
}
src/IDF/WikiPage.php
141141
142142
143143
144
144145
145146
146147
function preDelete()
{
IDF_Timeline::remove($this);
IDF_Search::remove($this);
}
function get_current_revision()

Archive Download the corresponding diff file

Page rendered in 0.07593s using 13 queries.