added file type to FormType Parser

This commit is contained in:
Jonathan Chan 2014-06-12 03:56:54 -04:00 committed by William DURAND
parent 96e5d15f1b
commit b124824a8d
2 changed files with 11 additions and 10 deletions

View File

@ -18,27 +18,27 @@ namespace Nelmio\ApiDocBundle;
*/ */
class DataTypes class DataTypes
{ {
const INTEGER = 'integer'; const INTEGER = 'integer';
const FLOAT = 'float'; const FLOAT = 'float';
const STRING = 'string'; const STRING = 'string';
const BOOLEAN = 'boolean'; const BOOLEAN = 'boolean';
const FILE = 'file'; const FILE = 'file';
const ENUM = 'choice'; const ENUM = 'choice';
const COLLECTION = 'collection'; const COLLECTION = 'collection';
const MODEL = 'model'; const MODEL = 'model';
const DATE = 'date'; const DATE = 'date';
const DATETIME = 'datetime'; const DATETIME = 'datetime';
const TIME = 'time'; const TIME = 'time';
/** /**
* Returns true if the supplied `actualType` value is considered a primitive type. Returns false, otherwise. * Returns true if the supplied `actualType` value is considered a primitive type. Returns false, otherwise.

View File

@ -46,6 +46,7 @@ class FormTypeParser implements ParserInterface
'textarea' => DataTypes::STRING, 'textarea' => DataTypes::STRING,
'country' => DataTypes::STRING, 'country' => DataTypes::STRING,
'choice' => DataTypes::ENUM, 'choice' => DataTypes::ENUM,
'file' => DataTypes::FILE,
); );
public function __construct(FormFactoryInterface $formFactory) public function __construct(FormFactoryInterface $formFactory)