2009-06-06 01:40:47 +04:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* This software consists of voluntary contributions made by many individuals
|
2012-05-26 16:37:00 +04:00
|
|
|
* and is licensed under the MIT license. For more information, see
|
2009-06-06 01:40:47 +04:00
|
|
|
* <http://www.doctrine-project.org>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Doctrine\ORM\Mapping\Driver;
|
|
|
|
|
|
|
|
use Doctrine\ORM\Mapping\MappingException;
|
2012-01-17 15:32:10 +04:00
|
|
|
use Doctrine\Common\Persistence\Mapping\Driver\FileDriver;
|
2009-06-06 01:40:47 +04:00
|
|
|
|
|
|
|
/**
|
2009-06-30 20:00:28 +04:00
|
|
|
* Base driver for file-based metadata drivers.
|
2011-12-20 01:56:19 +04:00
|
|
|
*
|
2009-12-16 00:06:32 +03:00
|
|
|
* A file driver operates in a mode where it loads the mapping files of individual
|
|
|
|
* classes on demand. This requires the user to adhere to the convention of 1 mapping
|
|
|
|
* file per class and the file names of the mapping files must correspond to the full
|
|
|
|
* class name, including namespace, with the namespace delimiters '\', replaced by dots '.'.
|
2009-06-06 01:40:47 +04:00
|
|
|
*
|
|
|
|
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
|
|
|
* @link www.doctrine-project.com
|
|
|
|
* @since 2.0
|
2010-01-28 15:46:12 +03:00
|
|
|
* @author Benjamin Eberlei <kontakt@beberlei.de>
|
|
|
|
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
|
2009-06-06 01:40:47 +04:00
|
|
|
* @author Jonathan H. Wage <jonwage@gmail.com>
|
2009-12-16 00:06:32 +03:00
|
|
|
* @author Roman Borschel <roman@code-factory.org>
|
2009-06-06 01:40:47 +04:00
|
|
|
*/
|
2012-01-17 15:32:10 +04:00
|
|
|
abstract class AbstractFileDriver extends FileDriver implements Driver
|
2009-06-06 01:40:47 +04:00
|
|
|
{
|
2010-01-28 22:38:16 +03:00
|
|
|
/**
|
|
|
|
* Append lookup paths to metadata driver.
|
|
|
|
*
|
|
|
|
* @param array $paths
|
2009-06-06 01:40:47 +04:00
|
|
|
*/
|
2010-01-28 22:38:16 +03:00
|
|
|
public function addPaths(array $paths)
|
|
|
|
{
|
2012-01-17 15:32:10 +04:00
|
|
|
$this->locator->addPaths($paths);
|
2010-01-28 22:38:16 +03:00
|
|
|
}
|
2010-04-10 02:00:36 +04:00
|
|
|
|
2010-01-28 22:38:16 +03:00
|
|
|
/**
|
|
|
|
* Retrieve the defined metadata lookup paths.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getPaths()
|
|
|
|
{
|
2012-01-17 15:32:10 +04:00
|
|
|
return $this->locator->getPaths();
|
2009-06-06 01:40:47 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2012-01-17 15:32:10 +04:00
|
|
|
protected function findMappingFile($className)
|
2009-06-06 01:40:47 +04:00
|
|
|
{
|
2012-01-17 15:32:10 +04:00
|
|
|
return $this->locator->findMappingFile($className);
|
2010-01-28 15:46:12 +03:00
|
|
|
}
|
2012-01-17 15:32:10 +04:00
|
|
|
}
|