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);
|
2006-08-30 11:18:02 +04:00
|
|
|
$this->setAttribute(Doctrine::ATTR_QUERY_LIMIT, Doctrine::LIMIT_ROWS);
|
2006-08-22 03:16:55 +04:00
|
|
|
parent::__construct($manager,$pdo);
|
2006-08-31 13:04:14 +04:00
|
|
|
}
|
2006-09-15 13:08:44 +04:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
/**
|
2006-10-21 01:54:16 +04:00
|
|
|
* Returns string to concatenate two or more string parameters
|
2006-08-22 03:16:55 +04:00
|
|
|
*
|
2006-10-21 01:54:16 +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
|
|
|
*/
|
2006-10-21 01:54:16 +04:00
|
|
|
public function concat($value1, $value2) {
|
|
|
|
$args = func_get_args();
|
|
|
|
return "CONCAT(".implode(', ', $args).")";
|
2006-08-22 03:16:55 +04:00
|
|
|
}
|
|
|
|
}
|
2006-09-04 02:46:30 +04:00
|
|
|
|