|
@@ -27,18 +27,6 @@ class Yaml extends File implements Driver
|
|
|
*/
|
|
|
protected $_extension = '.dcm.yml';
|
|
|
|
|
|
- /**
|
|
|
- * List of types which are valid for translation,
|
|
|
- * this property is public and you can add some
|
|
|
- * other types in case it needs translation
|
|
|
- *
|
|
|
- * @var array
|
|
|
- */
|
|
|
- protected $validTypes = array(
|
|
|
- 'string',
|
|
|
- 'text'
|
|
|
- );
|
|
|
-
|
|
|
/**
|
|
|
* {@inheritDoc}
|
|
|
*/
|
|
@@ -70,9 +58,6 @@ class Yaml extends File implements Driver
|
|
|
foreach ($mapping['fields'] as $field => $fieldMapping) {
|
|
|
if (isset($fieldMapping['gedmo'])) {
|
|
|
if (in_array('translatable', $fieldMapping['gedmo'])) {
|
|
|
- if (!$this->isValidField($meta, $field)) {
|
|
|
- throw new InvalidMappingException("Translatable field - [{$field}] type is not valid and must be 'string' or 'text' in class - {$meta->name}");
|
|
|
- }
|
|
|
// fields cannot be overrided and throws mapping exception
|
|
|
$config['fields'][] = $field;
|
|
|
}
|
|
@@ -88,17 +73,4 @@ class Yaml extends File implements Driver
|
|
|
{
|
|
|
return \Symfony\Component\Yaml\Yaml::load($file);
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * Checks if $field type is valid as Translatable field
|
|
|
- *
|
|
|
- * @param ClassMetadata $meta
|
|
|
- * @param string $field
|
|
|
- * @return boolean
|
|
|
- */
|
|
|
- protected function isValidField(ClassMetadata $meta, $field)
|
|
|
- {
|
|
|
- $mapping = $meta->getFieldMapping($field);
|
|
|
- return $mapping && in_array($mapping['type'], $this->validTypes);
|
|
|
- }
|
|
|
}
|