PHRAS-1279_SUBSTITUTE-UNKNOWN-TYPE

- new : added type "unknown" to subviews setup so an "unknown"-type document can have substituted subdefs
This commit is contained in:
Jean-Yves Gaulier
2016-11-03 17:41:39 +01:00
parent 41be6154ed
commit 4e5d0758e6
3 changed files with 24 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ class MediaTypeFactory
return new Type\Document();
case Type\Type::TYPE_FLASH:
return new Type\Flash();
case Type\Type::TYPE_UNKNOWN:
return new Type\Unknown();
}
throw new \RuntimeException('Could not create requested media type');

View File

@@ -18,6 +18,7 @@ interface Type
const TYPE_DOCUMENT = 'document';
const TYPE_FLASH = 'flash';
const TYPE_IMAGE = 'image';
const TYPE_UNKNOWN = 'unknown';
public function getType();
}

View File

@@ -0,0 +1,21 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Media\Type;
class Unknown implements Type
{
public function getType()
{
return self::TYPE_UNKNOWN;
}
}