Created
February 20, 2014 12:20
-
-
Save mlebkowski/9112314 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function updateSphinxRTIndex($isDelete = false) | |
{ | |
$indexer = Xplod::getInstance()->getContainer()->get('search.listener.realtime_indexer'); | |
$propelModel = $this->toPropelModel(); | |
if ($this->isNew()) | |
{ | |
$indexer->queueInsert($propelModel); | |
} | |
elseif ($isDelete) | |
{ | |
$indexer->queueDelete($propelModel); | |
} | |
else | |
{ | |
$indexer->queueUpdate($propelModel); | |
} | |
$data = $this->getFillData(); | |
if (!empty($data['doctor_id'])) | |
{ | |
$object = ORMDoctorManager::retrieveById($data['doctor_id']); | |
} | |
elseif (!empty($data['facility_id'])) | |
{ | |
$object = ORMFacilityManager::retrieveById($data['facility_id']); | |
} | |
if ($object) | |
{ | |
$propelModel = $object->toPropelModel(); | |
$indexer->queueUpdate($propelModel); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
moze miec i doctor_id i facility_id, wiec $object musi byc arayem