Daniel 1 год назад
Родитель
Сommit
df3404fe63
4 измененных файлов: 16 добавлений и 1 удалений
  1. +1
    -1
      export/openapi.json
  2. +12
    -0
      export/openapi.yaml
  3. +1
    -0
      src/ApiResource/PostingApi.php
  4. +2
    -0
      src/Mapper/PostingEntityToApiMapper.php

+ 1
- 1
export/openapi.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 12
- 0
export/openapi.yaml Просмотреть файл

@@ -5450,6 +5450,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:
@@ -5581,6 +5585,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:
@@ -5719,6 +5727,10 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
numComments:
type:
- integer
- 'null'
createdAt:
readOnly: true
type:


+ 1
- 0
src/ApiResource/PostingApi.php Просмотреть файл

@@ -173,6 +173,7 @@ class PostingApi implements OwnerInterface
#[Groups(['posting:create'])]
public ?SaleApi $saleIri = null;

public ?int $numComments = null;

#[ApiProperty(writable: false)]
public ?\DateTimeImmutable $createdAt = null;


+ 2
- 0
src/Mapper/PostingEntityToApiMapper.php Просмотреть файл

@@ -68,6 +68,8 @@ class PostingEntityToApiMapper implements MapperInterface
]);
}

$dto->numComments = count($entity->getComments());

$dto->createdAt = $entity->getCreatedAt();

return $dto;


Загрузка…
Отмена
Сохранить