| @@ 83-100 (lines=18) @@ | ||
| 80 | /** |
|
| 81 | * @return SS_HTTPResponse |
|
| 82 | */ |
|
| 83 | protected function createFetch() { |
|
| 84 | /** @var DNGitFetch $fetch */ |
|
| 85 | $fetch = DNGitFetch::create(); |
|
| 86 | $fetch->ProjectID = $this->record->ID; |
|
| 87 | $fetch->write(); |
|
| 88 | $fetch->start(); |
|
| 89 | ||
| 90 | $location = Director::absoluteBaseURL() . $this->Link() . '/fetch/' . $fetch->ID; |
|
| 91 | $output = array( |
|
| 92 | 'message' => 'Fetch queued as job ' . $fetch->ResqueToken, |
|
| 93 | 'href' => $location, |
|
| 94 | ); |
|
| 95 | ||
| 96 | $response = $this->getAPIResponse($output); |
|
| 97 | $response->setStatusCode(201); |
|
| 98 | $response->addHeader('Location', $location); |
|
| 99 | return $response; |
|
| 100 | } |
|
| 101 | ||
| 102 | /** |
|
| 103 | * @return string |
|
| @@ 162-178 (lines=17) @@ | ||
| 159 | /** |
|
| 160 | * @return SS_HTTPResponse |
|
| 161 | */ |
|
| 162 | protected function createFetch() { |
|
| 163 | /** @var DNGitFetch $fetch */ |
|
| 164 | $fetch = DNGitFetch::create(); |
|
| 165 | $fetch->ProjectID = $this->project->ID; |
|
| 166 | $fetch->write(); |
|
| 167 | $fetch->start(); |
|
| 168 | ||
| 169 | $location = Director::absoluteBaseURL() . $this->Link() . '/gitupdate/' . $fetch->ID; |
|
| 170 | $output = array( |
|
| 171 | 'message' => 'Fetch queued as job ' . $fetch->ResqueToken, |
|
| 172 | 'href' => $location, |
|
| 173 | ); |
|
| 174 | ||
| 175 | $response = $this->getAPIResponse($output, 201); |
|
| 176 | $response->addHeader('Location', $location); |
|
| 177 | return $response; |
|
| 178 | } |
|
| 179 | ||
| 180 | /** |
|
| 181 | * @param $project |
|