Procházet zdrojové kódy

comment count

master
Daniel před 1 rokem
rodič
revize
df3404fe63
4 změnil soubory, kde provedl 16 přidání a 1 odebrání
  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
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 12
- 0
export/openapi.yaml Zobrazit soubor

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


+ 1
- 0
src/ApiResource/PostingApi.php Zobrazit soubor

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


public ?int $numComments = null;


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


+ 2
- 0
src/Mapper/PostingEntityToApiMapper.php Zobrazit soubor

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


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

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


return $dto; return $dto;


Načítá se…
Zrušit
Uložit