private function checkIfWasChachedAlready() { $dataMatchingCheckerDAO = new DataMatchingCheckerDAO(); $execInfo = $dataMatchingCheckerDAO->getRelationshipColumnCachingExecutionInfo($this->source->transformation); if (!isset($execInfo)) { // was not cached yet $dataMatchingCheckerDAO->setStartedRelationshipColumnCaching($this->source->transformation); return false; } else { //TODO: move strings to dao as constants $counter = 0; while ($execInfo->status == DataMatchingCheckerDAO::RelColCachExecInfoSt_InProgress) { sleep(10); $execInfo = $dataMatchingCheckerDAO->getRelationshipColumnCachingExecutionInfo($this->source->transformation); //TODO: add a check here if the start time is more than an hour ago, then just fail that execution // $counter += 1; if ($counter > 2) { break; } } if ($execInfo->status == DataMatchingCheckerDAO::RelColCachExecInfoSt_Success) { return true; } else { $dataMatchingCheckerDAO->setStartedRelationshipColumnCaching($this->source->transformation); return false; } } }