Doctrine\OXM\Mapping\MappingException::fieldTypeNotFound PHP Method

fieldTypeNotFound() public static method

public static fieldTypeNotFound ( $className, $fieldName, $type )
    public static function fieldTypeNotFound($className, $fieldName, $type)
    {
        return new self("The type '{$type}' on field '{$fieldName}' could not be found");
    }

Usage Example

 /**
  * Complete and validate type mappings
  *
  * @param string $className
  * @param ClassMetadataInfo $class
  */
 private function completeMappingTypeValidation($className, ClassMetadataInfo $class)
 {
     foreach ($class->fieldMappings as $fieldName => $mapping) {
         if (Type::hasType($mapping['type'])) {
             continue;
         }
         // Support type as a mapped class?
         if (!$this->hasMetadataFor($mapping['type']) && !$this->getMetadataFor($mapping['type'])) {
             throw MappingException::fieldTypeNotFound($className, $fieldName, $mapping['type']);
         }
         // Mapped classes must have binding node type XML_ELEMENT
         if ($mapping['node'] !== ClassMetadataInfo::XML_ELEMENT) {
             throw MappingException::customTypeWithoutNodeElement($className, $fieldName);
         }
     }
 }