本文整理匯總了PHP中Doctrine\ORM\Configuration::addCustomStringFunction方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configuration::addCustomStringFunction方法的具體用法?PHP Configuration::addCustomStringFunction怎麽用?PHP Configuration::addCustomStringFunction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\ORM\Configuration
的用法示例。
在下文中一共展示了Configuration::addCustomStringFunction方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: connect
/**
* Connect and set-up Doctrine
*
* @return void
*/
public function connect()
{
$this->configuration = new \Doctrine\ORM\Configuration();
// Setup cache
$this->setDoctrineCache();
// Set metadata driver
$chain = new \Doctrine\ORM\Mapping\Driver\DriverChain();
$chain->addDriver($this->createAnnotationDriver(LC_DIR_CACHE_MODEL), 'XLite\\Model');
$iterator = new \RecursiveDirectoryIterator(LC_DIR_CACHE_CLASSES . 'XLite' . LC_DS . 'Module', \FilesystemIterator::SKIP_DOTS);
foreach ($iterator as $dir) {
if (\Includes\Utils\FileManager::isDir($dir->getPathName())) {
$iterator2 = new \RecursiveDirectoryIterator($dir->getPathName(), \FilesystemIterator::SKIP_DOTS);
foreach ($iterator2 as $dir2) {
if (\Includes\Utils\FileManager::isDir($dir2->getPathName()) && \Includes\Utils\FileManager::isDir($dir2->getPathName() . LC_DS . 'Model')) {
$chain->addDriver($this->createAnnotationDriver($dir2->getPathName() . LC_DS . 'Model'), 'XLite\\Module\\' . $dir->getBaseName() . '\\' . $dir2->getBaseName() . '\\Model');
}
}
}
}
$this->configuration->setMetadataDriverImpl($chain);
// Set proxy settings
$this->configuration->setProxyDir(rtrim(LC_DIR_CACHE_PROXY, LC_DS));
$this->configuration->setProxyNamespace(LC_MODEL_PROXY_NS);
$this->configuration->setAutoGenerateProxyClasses(false);
// Register custom functions
$this->configuration->addCustomStringFunction('if', '\\XLite\\Core\\Doctrine\\IfFunction');
$this->tablePrefix = \XLite::getInstance()->getOptions(array('database_details', 'table_prefix'));
// Initialize DB connection and entity manager
$this->startEntityManager();
}
示例2: testAddGetCustomStringFunction
public function testAddGetCustomStringFunction()
{
$this->configuration->addCustomStringFunction('FunctionName', __CLASS__);
$this->assertSame(__CLASS__, $this->configuration->getCustomStringFunction('FunctionName'));
$this->assertSame(null, $this->configuration->getCustomStringFunction('NonExistingFunction'));
$this->configuration->setCustomStringFunctions(array('OtherFunctionName' => __CLASS__));
$this->assertSame(__CLASS__, $this->configuration->getCustomStringFunction('OtherFunctionName'));
$this->setExpectedException('Doctrine\\ORM\\ORMException');
$this->configuration->addCustomStringFunction('concat', __CLASS__);
}
示例3: __construct
public function __construct()
{
// load database configuration from CodeIgniter
require_once APPPATH . 'config/database.php';
// Set up class loading. You could use different autoloaders, provided by your favorite framework,
// if you want to.
require_once APPPATH . 'libraries/Doctrine/Common/ClassLoader.php';
$doctrineClassLoader = new ClassLoader('Doctrine', APPPATH . 'libraries');
$doctrineClassLoader->register();
$symfonyClassLoader = new ClassLoader('Symfony', APPPATH . 'libraries/Doctrine');
$symfonyClassLoader->register();
$entitiesClassLoader = new ClassLoader('Entities', APPPATH . "models");
$entitiesClassLoader->register();
$proxiesClassLoader = new ClassLoader('Proxies', APPPATH . "models");
$proxiesClassLoader->register();
$extraClassLoader = new ClassLoader('DoctrineExtra', APPPATH . 'libraries');
$extraClassLoader->register();
// Set up caches
$config = new Configuration();
$cache = new ArrayCache();
$config->setMetadataCacheImpl($cache);
$driverImpl = $config->newDefaultAnnotationDriver(array(APPPATH . 'models/Entities'));
$config->setMetadataDriverImpl($driverImpl);
$config->setQueryCacheImpl($cache);
// Proxy configuration
$config->setProxyDir(APPPATH . '/models/Proxies');
$config->setProxyNamespace('Proxies');
// Set up logger
//$logger = new EchoSQLLogger;
//$config->setSQLLogger($logger);
$config->setAutoGenerateProxyClasses(TRUE);
// Database connection information
$connectionOptions = array('driver' => $db['default']['dbdriver'] == 'mysqli' ? 'pdo_mysql' : 'pdo_pgsql', 'user' => $db['default']['username'], 'password' => $db['default']['password'], 'host' => $db['default']['hostname'], 'dbname' => $db['default']['database']);
$config->addCustomStringFunction('MONTH', '\\DoctrineExtra\\DateMonth');
$config->addCustomStringFunction('YEAR', '\\DoctrineExtra\\DateYear');
// Create EntityManager
$this->em = EntityManager::create($connectionOptions, $config);
}
示例4: registerDqlFunction
/**
* @param string $type
* @param string $functionName
* @param string $functionClass
* @param Configuration $configuration
*/
protected function registerDqlFunction($type, $functionName, $functionClass, Configuration $configuration)
{
switch ($type) {
case 'datetime':
$configuration->addCustomDatetimeFunction($functionName, $functionClass);
break;
case 'numeric':
$configuration->addCustomNumericFunction($functionName, $functionClass);
break;
case 'string':
default:
$configuration->addCustomStringFunction($functionName, $functionClass);
}
}
示例5: load
/**
* @param Configuration $configuration
* @param string $database
*/
public static function load(Configuration $configuration, $database)
{
$parser = new Parser();
// Load the corresponding config file.
$config = $parser->parse(file_get_contents(realpath(__DIR__ . '/../../config/' . $database . '.yml')));
$parsed = $config['doctrine']['orm']['dql'];
// Load the existing function classes.
if (array_key_exists('datetime_functions', $parsed)) {
foreach ($parsed['datetime_functions'] as $key => $value) {
$configuration->addCustomDatetimeFunction(strtoupper($key), $value);
}
}
if (array_key_exists('numeric_functions', $parsed)) {
foreach ($parsed['numeric_functions'] as $key => $value) {
$configuration->addCustomNumericFunction(strtoupper($key), $value);
}
}
if (array_key_exists('string_functions', $parsed)) {
foreach ($parsed['string_functions'] as $key => $value) {
$configuration->addCustomStringFunction(strtoupper($key), $value);
}
}
}
示例6: connect
/**
* Connect and set-up Doctrine
*
* @return void
*/
public function connect()
{
$this->configuration = new \Doctrine\ORM\Configuration();
// Setup cache
$this->setDoctrineCache();
// Set metadata driver
$chain = new \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain();
$chain->addDriver($this->createAnnotationDriver(\Includes\Decorator\ADecorator::getCacheModelsDir()), 'XLite\\Model');
$iterator = new \RecursiveDirectoryIterator(\Includes\Decorator\ADecorator::getCacheClassesDir() . 'XLite' . LC_DS . 'Module', \FilesystemIterator::SKIP_DOTS);
foreach ($iterator as $dir) {
if (\Includes\Utils\FileManager::isDir($dir->getPathName())) {
$iterator2 = new \RecursiveDirectoryIterator($dir->getPathName(), \FilesystemIterator::SKIP_DOTS);
foreach ($iterator2 as $dir2) {
if (\Includes\Utils\FileManager::isDir($dir2->getPathName()) && \Includes\Utils\FileManager::isDir($dir2->getPathName() . LC_DS . 'Model')) {
$chain->addDriver($this->createAnnotationDriver($dir2->getPathName() . LC_DS . 'Model'), 'XLite\\Module\\' . $dir->getBaseName() . '\\' . $dir2->getBaseName() . '\\Model');
}
}
}
}
$this->configuration->setMetadataDriverImpl($chain);
// Set proxy settings
$this->configuration->setProxyDir(rtrim(\Includes\Decorator\ADecorator::getCacheModelProxiesDir(), LC_DS));
$this->configuration->setProxyNamespace(LC_MODEL_PROXY_NS);
$this->configuration->setAutoGenerateProxyClasses(false);
// Register custom functions
$this->configuration->addCustomStringFunction('if', '\\XLite\\Core\\Doctrine\\IfFunction');
$this->configuration->addCustomStringFunction('IFNULL', '\\XLite\\Core\\Doctrine\\IfnullFunction');
$this->configuration->addCustomStringFunction('relevance', '\\XLite\\Core\\Doctrine\\RelevanceFunction');
$this->configuration->addCustomNumericFunction('intval', '\\XLite\\Core\\Doctrine\\IntvalFunction');
$this->configuration->addCustomStringFunction('findInSet', '\\XLite\\Core\\Doctrine\\FindInSetFunction');
$this->configuration->addCustomStringFunction('castChar', '\\XLite\\Core\\Doctrine\\CastCharFunction');
$this->configuration->addCustomStringFunction('collate', '\\XLite\\Core\\Doctrine\\CollateFunction');
$this->tablePrefix = trim(\XLite::getInstance()->getOptions(array('database_details', 'table_prefix')));
// Initialize DB connection and entity manager
$this->startEntityManager();
}
示例7: addCustomFunctions
/**
* Adds userdefined functions.
*
* @param Configuration $config
* @param array $options
* @return Configuration
*/
private static function addCustomFunctions(Configuration $config, array $options = array())
{
if (null !== ($strFcts = Collection::get($options, 'orm:entity_managers:default:dql:string_functions'))) {
foreach ($strFcts as $name => $class) {
if (class_exists($class)) {
$config->addCustomStringFunction($name, $class);
}
}
}
if (null !== ($numFcts = Collection::get($options, 'orm:entity_managers:default:dql:numeric_functions'))) {
foreach ($numFcts as $name => $class) {
if (class_exists($class)) {
$config->addCustomNumericFunction($name, $class);
}
}
}
if (null !== ($datetimeFcts = Collection::get($options, 'orm:entity_managers:default:dql:datetime_functions'))) {
foreach ($datetimeFcts as $name => $class) {
if (class_exists($class)) {
$config->addCustomDatetimeFunction($name, $class);
}
}
}
return $config;
}
示例8: configure
public static function configure(Configuration $configuration)
{
$configuration->addCustomStringFunction('ST_Box2dFromGeoHash', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Box2dFromGeoHash');
$configuration->addCustomStringFunction('ST_GeogFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeogFromText');
$configuration->addCustomStringFunction('ST_GeographyFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeographyFromText');
$configuration->addCustomStringFunction('ST_GeogFromWKB', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeogFromWKB');
$configuration->addCustomStringFunction('ST_GeomCollFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomCollFromText');
$configuration->addCustomStringFunction('ST_GeomFromEWKB', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomFromEWKB');
$configuration->addCustomStringFunction('ST_GeomFromEWKT', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomFromEWKT');
$configuration->addCustomStringFunction('ST_GeomFromGeoHash', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomFromGeoHash');
$configuration->addCustomStringFunction('ST_GeomFromGML', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomFromGML');
$configuration->addCustomStringFunction('ST_GeomFromGeoJSON', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomFromGeoJSON');
$configuration->addCustomStringFunction('ST_GeomFromKML', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomFromKML');
$configuration->addCustomStringFunction('ST_GeomFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomFromText');
$configuration->addCustomStringFunction('ST_GeometryFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeometryFromText');
$configuration->addCustomStringFunction('ST_GeomFromWKB', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeomFromWKB');
$configuration->addCustomStringFunction('ST_LineFromMultiPoint', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_LineFromMultiPoint');
$configuration->addCustomStringFunction('ST_LineFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_LineFromText');
$configuration->addCustomStringFunction('ST_LineFromWKB', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_LineFromWKB');
$configuration->addCustomStringFunction('ST_LinestringFromWKB', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_LinestringFromWKB');
$configuration->addCustomStringFunction('ST_MakeBox2D', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MakeBox2D');
$configuration->addCustomStringFunction('ST_3DMakeBox', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_3DMakeBox');
$configuration->addCustomStringFunction('ST_MakeBox3D', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MakeBox3D');
$configuration->addCustomStringFunction('ST_MakeLine', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MakeLine');
$configuration->addCustomStringFunction('ST_MakeEnvelope', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MakeEnvelope');
$configuration->addCustomStringFunction('ST_MakePolygon', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MakePolygon');
$configuration->addCustomStringFunction('ST_MakePoint', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MakePoint');
$configuration->addCustomStringFunction('ST_MakePointM', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MakePointM');
$configuration->addCustomStringFunction('ST_MLineFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MLineFromText');
$configuration->addCustomStringFunction('ST_MPointFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MPointFromText');
$configuration->addCustomStringFunction('ST_MPolyFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_MPolyFromText');
$configuration->addCustomStringFunction('ST_Point', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Point');
$configuration->addCustomStringFunction('ST_PointFromGeoHash', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_PointFromGeoHash');
$configuration->addCustomStringFunction('ST_PointFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_PointFromText');
$configuration->addCustomStringFunction('ST_PointFromWKB', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_PointFromWKB');
$configuration->addCustomStringFunction('ST_Polygon', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Polygon');
$configuration->addCustomStringFunction('ST_PolygonFromText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_PolygonFromText');
$configuration->addCustomStringFunction('GeometryType', 'Jsor\\Doctrine\\PostGIS\\Functions\\GeometryType');
$configuration->addCustomStringFunction('ST_Boundary', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Boundary');
$configuration->addCustomNumericFunction('ST_CoordDim', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_CoordDim');
$configuration->addCustomNumericFunction('ST_Dimension', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Dimension');
$configuration->addCustomStringFunction('ST_EndPoint', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_EndPoint');
$configuration->addCustomStringFunction('ST_Envelope', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Envelope');
$configuration->addCustomStringFunction('ST_ExteriorRing', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_ExteriorRing');
$configuration->addCustomStringFunction('ST_GeometryN', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeometryN');
$configuration->addCustomStringFunction('ST_GeometryType', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeometryType');
$configuration->addCustomStringFunction('ST_InteriorRingN', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_InteriorRingN');
$configuration->addCustomStringFunction('ST_IsClosed', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_IsClosed');
$configuration->addCustomStringFunction('ST_IsCollection', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_IsCollection');
$configuration->addCustomStringFunction('ST_IsEmpty', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_IsEmpty');
$configuration->addCustomStringFunction('ST_IsRing', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_IsRing');
$configuration->addCustomStringFunction('ST_IsSimple', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_IsSimple');
$configuration->addCustomStringFunction('ST_IsValid', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_IsValid');
$configuration->addCustomStringFunction('ST_IsValidReason', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_IsValidReason');
$configuration->addCustomStringFunction('ST_IsValidDetail', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_IsValidDetail');
$configuration->addCustomNumericFunction('ST_M', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_M');
$configuration->addCustomNumericFunction('ST_NDims', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_NDims');
$configuration->addCustomNumericFunction('ST_NPoints', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_NPoints');
$configuration->addCustomNumericFunction('ST_NRings', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_NRings');
$configuration->addCustomNumericFunction('ST_NumGeometries', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_NumGeometries');
$configuration->addCustomNumericFunction('ST_NumInteriorRings', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_NumInteriorRings');
$configuration->addCustomNumericFunction('ST_NumInteriorRing', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_NumInteriorRing');
$configuration->addCustomNumericFunction('ST_NumPatches', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_NumPatches');
$configuration->addCustomNumericFunction('ST_NumPoints', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_NumPoints');
$configuration->addCustomStringFunction('ST_PatchN', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_PatchN');
$configuration->addCustomStringFunction('ST_PointN', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_PointN');
$configuration->addCustomNumericFunction('ST_SRID', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_SRID');
$configuration->addCustomStringFunction('ST_StartPoint', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_StartPoint');
$configuration->addCustomStringFunction('ST_Summary', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Summary');
$configuration->addCustomNumericFunction('ST_X', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_X');
$configuration->addCustomNumericFunction('ST_XMax', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_XMax');
$configuration->addCustomNumericFunction('ST_XMin', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_XMin');
$configuration->addCustomNumericFunction('ST_Y', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Y');
$configuration->addCustomNumericFunction('ST_YMax', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_YMax');
$configuration->addCustomNumericFunction('ST_YMin', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_YMin');
$configuration->addCustomNumericFunction('ST_Z', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Z');
$configuration->addCustomNumericFunction('ST_ZMax', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_ZMax');
$configuration->addCustomNumericFunction('ST_Zmflag', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Zmflag');
$configuration->addCustomNumericFunction('ST_ZMin', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_ZMin');
$configuration->addCustomStringFunction('ST_Multi', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Multi');
$configuration->addCustomStringFunction('ST_Scale', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Scale');
$configuration->addCustomStringFunction('ST_SetSRID', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_SetSRID');
$configuration->addCustomStringFunction('ST_Transform', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Transform');
$configuration->addCustomStringFunction('ST_Translate', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_Translate');
$configuration->addCustomStringFunction('ST_TransScale', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_TransScale');
$configuration->addCustomStringFunction('ST_AsBinary', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsBinary');
$configuration->addCustomStringFunction('ST_AsEWKB', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsEWKB');
$configuration->addCustomStringFunction('ST_AsEWKT', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsEWKT');
$configuration->addCustomStringFunction('ST_AsGeoJSON', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsGeoJSON');
$configuration->addCustomStringFunction('ST_AsGML', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsGML');
$configuration->addCustomStringFunction('ST_AsHEXEWKB', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsHEXEWKB');
$configuration->addCustomStringFunction('ST_AsKML', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsKML');
$configuration->addCustomStringFunction('ST_AsSVG', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsSVG');
$configuration->addCustomStringFunction('ST_GeoHash', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_GeoHash');
$configuration->addCustomStringFunction('ST_AsLatLonText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsLatLonText');
$configuration->addCustomStringFunction('ST_AsText', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_AsText');
$configuration->addCustomStringFunction('ST_3DClosestPoint', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_3DClosestPoint');
$configuration->addCustomNumericFunction('ST_3DDistance', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_3DDistance');
$configuration->addCustomStringFunction('ST_3DDWithin', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_3DDWithin');
$configuration->addCustomStringFunction('ST_3DDFullyWithin', 'Jsor\\Doctrine\\PostGIS\\Functions\\ST_3DDFullyWithin');
//.........這裏部分代碼省略.........
示例9: setupCustomFunctions
protected function setupCustomFunctions(Configuration $config, $spec)
{
foreach ($spec['custom_hydration_modes'] as $name => $classname) {
$config->addCustomHydrationMode($name, $classname);
}
foreach ($spec['custom_datetime_functions'] as $name => $classname) {
$config->addCustomDatetimeFunction($name, $classname);
}
foreach ($spec['custom_numeric_functions'] as $name => $classname) {
$config->addCustomNumericFunction($name, $classname);
}
foreach ($spec['custom_string_functions'] as $name => $classname) {
$config->addCustomStringFunction($name, $classname);
}
foreach ($spec['filters'] as $name => $classname) {
$config->addFilter($name, $classname);
}
}