/** * @param string|DateTime $updatedSince * @return string */ public function getAll($updatedSince = null) { $newUri = null; $newUri = '?' . http_build_query(array('updated_since' => $this->_appendUpdatedSinceParam($updatedSince))); $this->_uri = self::HARVEST_PATH . $newUri; return parent::getAll(); }
/** * @param string $basePath * @param string $dateFrom * @param string $dateTo * @param string|DateTime $updatedSince * @return string */ private function getAllWithParams($basePath, $dateFrom, $dateTo = null, $updatedSince = null) { $newUri = null; if (is_null($dateTo)) { $dateTo = date("Ymd"); } $newUri = '?' . http_build_query(array('from' => $dateFrom, 'to' => $dateTo, 'updated_since' => $this->_appendUpdatedSinceParam($updatedSince))); $this->_uri = $basePath . self::HARVEST_PATH . $newUri; return parent::getAll(); }
/** * @param DateTime $forDay * @param integer $userId * @param integer $slim * @return string */ public function getAllForDay(\DateTime $forDay = null, $userId = null, $slim = 1) { // TODO: http://help.getharvest.com/api/reports-api/reports/time-reports/ if (is_null($forDay)) { $forDay = new \DateTime(); } $dayOfTheYear = $forDay->format("z") + 1; $year = $forDay->format("Y"); $newUri = null; $newUri = '?' . http_build_query(array('slim' => $slim, 'of_user' => $userId)); $this->_uri = self::HARVEST_PATH_DAILY . "/{$dayOfTheYear}/{$year}" . $newUri; return parent::getAll(); }