diff --git a/src/Facade/Requests/CalDAVRequestFactory.php b/src/Facade/Requests/CalDAVRequestFactory.php index 139856d..738b6fd 100644 --- a/src/Facade/Requests/CalDAVRequestFactory.php +++ b/src/Facade/Requests/CalDAVRequestFactory.php @@ -16,34 +16,31 @@ * Class CalDAVRequestFactory * @package CalDAVClient\Facade\Requests */ -final class CalDAVRequestFactory +final class CalDAVRequestFactory implements ICalDAVRequestFactory { - const PrincipalRequestType = 'PRINCIPAL'; - const CalendarHomeRequestType = 'CALENDAR_HOME'; - const CalendarsRequestType = 'CALENDARS'; - const CalendarRequestType = 'CALENDAR'; - const CalendarSyncRequestType = 'CALENDAR_SYNC'; - const CalendarMultiGetRequestType = 'CALENDAR_MULTIGET'; - const CalendarQueryRequestType = 'CALENDAR_QUERY'; - const CalendarCreateRequestType = 'CREATE_CALENDAR'; - const EventCreateRequestType = 'CREATE_EVENT'; - const EventUpdateRequestType = 'UPDATE_EVENT'; - private function __construct(){} /** - * @var CalDAVRequestFactory + * @var ICalDAVRequestFactory */ private static $instance; /** - * @return CalDAVRequestFactory + * @return ICalDAVRequestFactory */ public static function getInstance(){ if(is_null(self::$instance)) self::$instance = new CalDAVRequestFactory(); return self::$instance; } + /** + * Override which class is used to create new request objects. + * @param ICalDAVRequestFactory $factory + */ + public static function setInstance(ICalDAVRequestFactory $factory) { + self::$instance = $factory; + } + /** * @param string $type * @param array $params diff --git a/src/Facade/Requests/ICalDAVRequestFactory.php b/src/Facade/Requests/ICalDAVRequestFactory.php new file mode 100644 index 0000000..96458f8 --- /dev/null +++ b/src/Facade/Requests/ICalDAVRequestFactory.php @@ -0,0 +1,40 @@ +content['response']['href']) ? $this->content['response']['href'] : null; } + /** + * @return array + */ + public function getFoundProps() { + return $this->found_props; + } + + /** + * @return array + */ + public function getNotFoundProps() { + return $this->not_found_props; + } + /** * @return bool */