本文整理匯總了PHP中Doctrine\ORM\Mapping\MappingException::annotationDriverRequiresConfiguredDirectoryPath方法的典型用法代碼示例。如果您正苦於以下問題:PHP MappingException::annotationDriverRequiresConfiguredDirectoryPath方法的具體用法?PHP MappingException::annotationDriverRequiresConfiguredDirectoryPath怎麽用?PHP MappingException::annotationDriverRequiresConfiguredDirectoryPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\ORM\Mapping\MappingException
的用法示例。
在下文中一共展示了MappingException::annotationDriverRequiresConfiguredDirectoryPath方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAllClassNames
/**
* {@inheritDoc}
*/
public function getAllClassNames()
{
$classes = array();
if ($this->_paths) {
$declared = get_declared_classes();
foreach ((array) $this->_paths as $path) {
if (!is_dir($path)) {
throw MappingException::annotationDriverRequiresConfiguredDirectoryPath();
}
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($iterator as $file) {
if (($fileName = $file->getBasename($this->_fileExtension)) == $file->getBasename()) {
continue;
}
require_once $file->getPathName();
}
}
$declared = array_diff(get_declared_classes(), $declared);
foreach ($declared as $className) {
if (!$this->isTransient($className)) {
$classes[] = $className;
}
}
}
return $classes;
}