| @@ 490-507 (lines=18) @@ | ||
| 487 | * |
|
| 488 | * @return \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition |
|
| 489 | */ |
|
| 490 | public function getFieldDefinition($id, $status) |
|
| 491 | { |
|
| 492 | $rows = $this->contentTypeGateway->loadFieldDefinition($id, $status); |
|
| 493 | ||
| 494 | if ($rows === false) { |
|
| 495 | throw new NotFoundException( |
|
| 496 | 'FieldDefinition', |
|
| 497 | array( |
|
| 498 | 'id' => $id, |
|
| 499 | 'status' => $status, |
|
| 500 | ) |
|
| 501 | ); |
|
| 502 | } |
|
| 503 | ||
| 504 | $multilingualData = $this->mapper->extractMultilingualData($rows); |
|
| 505 | ||
| 506 | return $this->mapper->extractFieldFromRow(reset($rows), $multilingualData); |
|
| 507 | } |
|
| 508 | ||
| 509 | /** |
|
| 510 | * Counts the number of Content instances of the ContentType identified by given $contentTypeId. |
|
| @@ 508-521 (lines=14) @@ | ||
| 505 | * |
|
| 506 | * @return \eZ\Publish\SPI\Persistence\Content\VersionInfo |
|
| 507 | */ |
|
| 508 | public function loadVersionInfo($contentId, $versionNo) |
|
| 509 | { |
|
| 510 | $rows = $this->contentGateway->loadVersionInfo($contentId, $versionNo); |
|
| 511 | if (empty($rows)) { |
|
| 512 | throw new NotFound('content', $contentId); |
|
| 513 | } |
|
| 514 | ||
| 515 | $versionInfo = $this->mapper->extractVersionInfoListFromRows( |
|
| 516 | $rows, |
|
| 517 | $this->contentGateway->loadVersionedNameData(array(array('id' => $contentId, 'version' => $versionNo))) |
|
| 518 | ); |
|
| 519 | ||
| 520 | return reset($versionInfo); |
|
| 521 | } |
|
| 522 | ||
| 523 | /** |
|
| 524 | * Returns all versions with draft status created by the given $userId. |
|