2016-07-29 10:22:40 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2016-12-29 12:09:26 +01:00
|
|
|
* This file is part of the NelmioApiDocBundle package.
|
2016-07-29 10:22:40 +02:00
|
|
|
*
|
2016-12-29 12:09:26 +01:00
|
|
|
* (c) Nelmio
|
2016-07-29 10:22:40 +02:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2016-12-29 12:09:26 +01:00
|
|
|
namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;
|
2016-07-29 10:22:40 +02:00
|
|
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiProperty;
|
|
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Guilhem N. <egetick@gmail.com>
|
|
|
|
*
|
|
|
|
* @ApiResource(
|
2016-07-29 18:40:56 +02:00
|
|
|
* collectionOperations={
|
|
|
|
* "get"={"method"="GET"},
|
|
|
|
* "custom2"={"path"="/foo", "method"="GET"},
|
|
|
|
* "custom"={"path"="/foo", "method"="POST"},
|
|
|
|
* },
|
2016-07-29 10:22:40 +02:00
|
|
|
* itemOperations={"get"={"method"="GET"}})
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
class Dummy
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*
|
|
|
|
* @Assert\NotBlank
|
|
|
|
* @ApiProperty(iri="http://schema.org/name")
|
|
|
|
*/
|
|
|
|
private $name;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
private $foo;
|
|
|
|
|
|
|
|
public function getId(): int
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setName(string $name)
|
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName(): string
|
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function hasRole(string $role)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setFoo(array $foo = null)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|