Skip to content

Commit d5d1104

Browse files
committed
Add ODM docs for tests
1 parent 4b0b050 commit d5d1104

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Document;
15+
16+
use ApiPlatform\Core\Annotation\ApiResource;
17+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Dto\OutputDtoDummy;
18+
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
19+
20+
/**
21+
* Dummy InputOutput.
22+
*
23+
* @author Kévin Dunglas <[email protected]>
24+
*
25+
* @ApiResource(attributes={"output"=OutputDtoDummy::class})
26+
* @ODM\Document
27+
*/
28+
class DummyDtoOutputFallbackToSameClass
29+
{
30+
/**
31+
* @var int The id
32+
*
33+
* @ORM\Column(type="integer")
34+
* @ORM\Id
35+
* @ORM\GeneratedValue(strategy="AUTO")
36+
*/
37+
private $id;
38+
39+
/**
40+
* @var string
41+
*
42+
* @ORM\Column
43+
*/
44+
public $lorem;
45+
46+
/**
47+
* @var string
48+
*
49+
* @ORM\Column
50+
*/
51+
public $ipsum;
52+
53+
public function getId()
54+
{
55+
return $this->id;
56+
}
57+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Document;
15+
16+
use ApiPlatform\Core\Annotation\ApiResource;
17+
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
18+
19+
/**
20+
* Dummy InputOutput.
21+
*
22+
* @author Kévin Dunglas <[email protected]>
23+
*
24+
* @ApiResource(attributes={"output"=DummyDtoOutputSameClass::class})
25+
* @ODM\Document
26+
*/
27+
class DummyDtoOutputSameClass
28+
{
29+
/**
30+
* @var int The id
31+
*
32+
* @ORM\Column(type="integer")
33+
* @ORM\Id
34+
* @ORM\GeneratedValue(strategy="AUTO")
35+
*/
36+
private $id;
37+
38+
/**
39+
* @var string
40+
*
41+
* @ORM\Column
42+
*/
43+
public $lorem;
44+
45+
/**
46+
* @var string
47+
*
48+
* @ORM\Column
49+
*/
50+
public $ipsum;
51+
52+
public function getId()
53+
{
54+
return $this->id;
55+
}
56+
}

0 commit comments

Comments
 (0)