mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
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:
@@ -30,6 +30,8 @@ class MediaTypeFactory
|
|||||||
return new Type\Document();
|
return new Type\Document();
|
||||||
case Type\Type::TYPE_FLASH:
|
case Type\Type::TYPE_FLASH:
|
||||||
return new Type\Flash();
|
return new Type\Flash();
|
||||||
|
case Type\Type::TYPE_UNKNOWN:
|
||||||
|
return new Type\Unknown();
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \RuntimeException('Could not create requested media type');
|
throw new \RuntimeException('Could not create requested media type');
|
||||||
|
@@ -18,6 +18,7 @@ interface Type
|
|||||||
const TYPE_DOCUMENT = 'document';
|
const TYPE_DOCUMENT = 'document';
|
||||||
const TYPE_FLASH = 'flash';
|
const TYPE_FLASH = 'flash';
|
||||||
const TYPE_IMAGE = 'image';
|
const TYPE_IMAGE = 'image';
|
||||||
|
const TYPE_UNKNOWN = 'unknown';
|
||||||
|
|
||||||
public function getType();
|
public function getType();
|
||||||
}
|
}
|
||||||
|
21
lib/Alchemy/Phrasea/Media/Type/Unknown.php
Normal file
21
lib/Alchemy/Phrasea/Media/Type/Unknown.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user