public function makeSureHistoriesAreCorrect($interfaceHistoryModel) { // @TODO InterfaceHistoryModel type!!!!!! if ($interfaceHistoryModel instanceof \org\openacalendar\comments\models\AreaCommentHistoryModel) { $repo = new AreaCommentHistoryRepository(); $repo->ensureChangedFlagsAreSet($interfaceHistoryModel); } else { if ($interfaceHistoryModel instanceof \org\openacalendar\comments\models\EventCommentHistoryModel) { $repo = new EventCommentHistoryRepository(); $repo->ensureChangedFlagsAreSet($interfaceHistoryModel); } } }
protected function run() { $eventHistoryRepo = new EventCommentHistoryRepository(); $stat = $this->app['db']->prepare("SELECT * FROM event_comment_history"); $stat->execute(); $count = 0; while ($data = $stat->fetch()) { $eventHistory = new EventCommentHistoryModel(); $eventHistory->setFromDataBaseRow($data); $eventHistoryRepo->ensureChangedFlagsAreSet($eventHistory); ++$count; } return array('result' => 'ok', 'count' => $count); }