63 lines
1.1 KiB
PHP
Raw Normal View History

2017-01-14 17:36:56 +01:00
<?php
/*
* This file is part of the NelmioApiDocBundle package.
*
* (c) Nelmio
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\Model;
use Symfony\Component\PropertyInfo\Type;
final class Model
{
private $type;
2017-12-22 17:42:18 +00:00
2017-06-13 13:34:26 +02:00
private $groups;
2017-01-14 17:36:56 +01:00
private $options;
2017-06-13 13:34:26 +02:00
/**
* @param string[]|null $groups
*/
public function __construct(Type $type, array $groups = null, array $options = null)
2017-01-14 17:36:56 +01:00
{
$this->type = $type;
2017-06-13 13:34:26 +02:00
$this->groups = $groups;
$this->options = $options;
2017-01-14 17:36:56 +01:00
}
/**
2017-06-13 13:34:26 +02:00
* @return Type
2017-01-14 17:36:56 +01:00
*/
public function getType()
{
return $this->type;
}
2017-06-13 13:34:26 +02:00
/**
* @return string[]|null
*/
public function getGroups()
{
return $this->groups;
}
2017-03-17 19:37:41 +01:00
public function getHash(): string
2017-01-14 17:36:56 +01:00
{
2017-06-13 13:34:26 +02:00
return md5(serialize([$this->type, $this->groups]));
2017-01-14 17:36:56 +01:00
}
/**
* @return mixed[]|null
*/
public function getOptions()
{
return $this->options;
}
2017-01-14 17:36:56 +01:00
}