public function shouldReIndexEntry(array $modifiedColumns = array()) { //This case handles adding/deleting an existing cue point if (!count($modifiedColumns)) { return true; } $indexOnEntryTypes = CuePointPlugin::getIndexOnEntryTypes(); if (!count($indexOnEntryTypes)) { return false; } if (!in_array($this->getType(), $indexOnEntryTypes)) { return false; } //If modified columns has values we need to check that the fileds updated are the once that should trigger re-in $fieldsToMonitor = array(CuePointPeer::TEXT, CuePointPeer::TAGS, CuePointPeer::NAME); if (count(array_intersect($fieldsToMonitor, $modifiedColumns)) > 0) { return true; } return false; }
public static function shouldReIndexEntry(BaseObject $object, array $modifiedColumns) { if (!$object instanceof CuePoint) { return false; } $indexOnEntryTypes = CuePointPlugin::getIndexOnEntryTypes(); if (!count($indexOnEntryTypes)) { return false; } if (!in_array($object->getType(), $indexOnEntryTypes)) { return false; } $fieldsToMonitor = array(CuePointPeer::TEXT, CuePointPeer::TAGS, CuePointPeer::NAME); if (count(array_intersect($fieldsToMonitor, $modifiedColumns)) > 0) { return true; } return false; }