|
@@ 134-147 (lines=14) @@
|
| 131 |
|
* @return Website |
| 132 |
|
* @throws WebsiteDoesNotExistException |
| 133 |
|
*/ |
| 134 |
|
public function getWebsiteFromId($siteId) { |
| 135 |
|
$qb = $this->getWebsitesSelectSql(); |
| 136 |
|
$this->limitToId($qb, $siteId); |
| 137 |
|
|
| 138 |
|
$cursor = $qb->execute(); |
| 139 |
|
$data = $cursor->fetch(); |
| 140 |
|
$cursor->closeCursor(); |
| 141 |
|
|
| 142 |
|
if ($data === false) { |
| 143 |
|
throw new WebsiteDoesNotExistException($this->l10n->t('Website not found')); |
| 144 |
|
} |
| 145 |
|
|
| 146 |
|
return $this->parseWebsitesSelectSql($data); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
|
| 150 |
|
/** |
|
@@ 158-171 (lines=14) @@
|
| 155 |
|
* @return Website |
| 156 |
|
* @throws WebsiteDoesNotExistException |
| 157 |
|
*/ |
| 158 |
|
public function getWebsiteFromSite($site) { |
| 159 |
|
$qb = $this->getWebsitesSelectSql(); |
| 160 |
|
$this->limitToSite($qb, $site); |
| 161 |
|
|
| 162 |
|
$cursor = $qb->execute(); |
| 163 |
|
$data = $cursor->fetch(); |
| 164 |
|
$cursor->closeCursor(); |
| 165 |
|
|
| 166 |
|
if ($data === false) { |
| 167 |
|
throw new WebsiteDoesNotExistException($this->l10n->t('Website not found')); |
| 168 |
|
} |
| 169 |
|
|
| 170 |
|
return $this->parseWebsitesSelectSql($data); |
| 171 |
|
} |
| 172 |
|
|
| 173 |
|
} |