本文整理汇总了PHP中Doctrine\ORM\Mapping\MappingException::mappingFileNotFound方法的典型用法代码示例。如果您正苦于以下问题:PHP MappingException::mappingFileNotFound方法的具体用法?PHP MappingException::mappingFileNotFound怎么用?PHP MappingException::mappingFileNotFound使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\Mapping\MappingException
的用法示例。
在下文中一共展示了MappingException::mappingFileNotFound方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findMappingFile
/**
* {@inheritDoc}
*/
public function findMappingFile($className)
{
if (!$this->fileExists($className)) {
throw MappingException::mappingFileNotFound($className, $this->paths[0]);
}
if (isset(self::$pathsMap[$className])) {
$this->paths = self::$pathsMap[$className];
}
return $this->paths[0];
}
示例2: _findMappingFile
protected function _findMappingFile($className)
{
foreach ($this->_paths as $prefix => $path) {
if (0 !== strpos($className, $prefix . '\\')) {
continue;
}
$filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', '.') . $this->_fileExtension;
if (file_exists($filename)) {
return $filename;
}
throw MappingException::mappingFileNotFound($className, $filename);
}
throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1) . $this->_fileExtension);
}
示例3: _findMappingFile
/**
* Finds the mapping file for the class with the given name by searching
* through the configured paths.
*
* @param $className
* @return string The (absolute) file name.
* @throws MappingException
*/
protected function _findMappingFile($className)
{
$fileName = str_replace('\\', '.', $className) . $this->_fileExtension;
// Check whether file exists
foreach ((array) $this->_paths as $path) {
if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {
return $path . DIRECTORY_SEPARATOR . $fileName;
}
}
throw MappingException::mappingFileNotFound($className, $fileName);
}