Doctrine\ODM\CouchDB\Mapping\MappingException::mappingNotFound PHP Method

mappingNotFound() public static method

public static mappingNotFound ( $className, $fieldName )
    public static function mappingNotFound($className, $fieldName)
    {
        return new self("No mapping found for field '{$fieldName}' in class '{$className}'.");
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Gets the mapping of a field.
  *
  * @param string $fieldName  The field name.
  * @return array  The field mapping.
  * @throws MappingException
  */
 public function getFieldMapping($fieldName)
 {
     if (!isset($this->fieldMappings[$fieldName])) {
         throw MappingException::mappingNotFound($this->name, $fieldName);
     }
     return $this->fieldMappings[$fieldName];
 }