| @@ 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. |
|
| @@ 458-471 (lines=14) @@ | ||
| 455 | * |
|
| 456 | * @return \eZ\Publish\SPI\Persistence\Content\VersionInfo |
|
| 457 | */ |
|
| 458 | public function loadVersionInfo($contentId, $versionNo) |
|
| 459 | { |
|
| 460 | $rows = $this->contentGateway->loadVersionInfo($contentId, $versionNo); |
|
| 461 | if (empty($rows)) { |
|
| 462 | throw new NotFound('content', $contentId); |
|
| 463 | } |
|
| 464 | ||
| 465 | $versionInfo = $this->mapper->extractVersionInfoListFromRows( |
|
| 466 | $rows, |
|
| 467 | $this->contentGateway->loadVersionedNameData(array(array('id' => $contentId, 'version' => $versionNo))) |
|
| 468 | ); |
|
| 469 | ||
| 470 | return reset($versionInfo); |
|
| 471 | } |
|
| 472 | ||
| 473 | /** |
|
| 474 | * Returns all versions with draft status created by the given $userId. |
|