1
0
mirror of synced 2024-12-14 23:26:04 +03:00
doctrine2/lib/Doctrine/Connection/Mysql.php

40 lines
1.1 KiB
PHP
Raw Normal View History

2006-08-22 03:16:55 +04:00
<?php
require_once("Common.php");
/**
* mysql driver
*/
class Doctrine_Connection_Mysql extends Doctrine_Connection_Common {
/**
* the constructor
* @param PDO $pdo -- database handle
*/
public function __construct(Doctrine_Manager $manager,PDO $pdo) {
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$this->setAttribute(Doctrine::ATTR_QUERY_LIMIT, Doctrine::LIMIT_ROWS);
2006-08-22 03:16:55 +04:00
parent::__construct($manager,$pdo);
}
/**
* returns the regular expression operator
* (implemented by the connection drivers)
*
* @return string
*/
public function getRegexpOperator() {
return 'RLIKE';
}
2006-08-22 03:16:55 +04:00
/**
* Returns string to concatenate two or more string parameters
2006-08-22 03:16:55 +04:00
*
* @param string $value1
* @param string $value2
* @param string $values...
* @return string a concatenation of two or more strings
2006-08-22 03:16:55 +04:00
*/
public function concat($value1, $value2) {
$args = func_get_args();
return "CONCAT(".implode(', ', $args).")";
2006-08-22 03:16:55 +04:00
}
}