Skip to content

Commit

Permalink
Use getDriver().
Browse files Browse the repository at this point in the history
Conflicts:
	kronolith/lib/Event.php
  • Loading branch information
yunosh committed Mar 17, 2015
1 parent e855a15 commit 6143a97
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions kronolith/lib/Event.php
Expand Up @@ -979,10 +979,9 @@ public function toiCalendar($calendar)
// exceptions. Any exceptions left should represent exceptions with
// no replacement.
$exceptions = $this->recurrence->getExceptions();
$kronolith_driver = Kronolith::getDriver(null, $this->calendar);
$search = new stdClass();
$search->baseid = $this->uid;
$results = $kronolith_driver->search($search);
$results = $this->getDriver()->search($search);
foreach ($results as $days) {
foreach ($days as $exceptionEvent) {
// Need to change the UID so it links to the original
Expand Down Expand Up @@ -1421,7 +1420,7 @@ protected function _handlevEventRecurrence($vEvent)
/* Delete all existing exceptions to this event if it already
* exists */
if (!empty($this->uid)) {
$kronolith_driver = Kronolith::getDriver(null, $this->calendar);
$kronolith_driver = $this->getDriver();
$search = new StdClass();
$search->baseid = $this->uid;
$results = $kronolith_driver->search($search);
Expand Down Expand Up @@ -1451,13 +1450,12 @@ protected function _handlevEventRecurrence($vEvent)
// RECURRENCE-ID indicates that this event represents an exception
try {
$recurrenceid = $vEvent->getAttribute('RECURRENCE-ID');
$kronolith_driver = Kronolith::getDriver(null, $this->calendar);
$originaldt = new Horde_Date($recurrenceid);
$this->exceptionoriginaldate = $originaldt;
$this->baseid = $this->uid;
$this->uid = null;
try {
$originalEvent = $kronolith_driver->getByUID($this->baseid);
$originalEvent = $this->getDriver()->getByUID($this->baseid);
$originalEvent->recurrence->addException($originaldt->format('Y'),
$originaldt->format('m'),
$originaldt->format('d'));
Expand Down Expand Up @@ -1542,7 +1540,7 @@ public function fromASAppointment(Horde_ActiveSync_Message_Appointment $message)
/* Recurrence */
if ($rrule = $message->getRecurrence()) {
/* Exceptions */
$kronolith_driver = Kronolith::getDriver(null, $this->calendar);
$kronolith_driver = $this->getDriver();
/* Since AS keeps exceptions as part of the original event, we need
* to delete all existing exceptions and re-create them. The only
* drawback to this is that the UIDs will change. */
Expand Down Expand Up @@ -2578,12 +2576,11 @@ public function boundExceptions($flat = true)
return array();
}
$return = array();
$kronolith_driver = Kronolith::getDriver(null, $this->calendar);
$search = new StdClass();
$search->start = $this->recurrence->getRecurStart();
$search->end = $this->recurrence->getRecurEnd();
$search->baseid = $this->uid;
$results = $kronolith_driver->search($search);
$results = $this->getDriver()->search($search);

if (!$flat) {
return $results;
Expand Down

0 comments on commit 6143a97

Please sign in to comment.