本文整理匯總了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);
}