forked from aimeos/aimeos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MySQL.php
46 lines (37 loc) · 980 Bytes
/
MySQL.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* @copyright Metaways Infosystems GmbH, 2011
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
* @copyright Aimeos (aimeos.org), 2015
* @package MShop
* @subpackage Index
*/
namespace Aimeos\MShop\Index\Manager;
/**
* MySQL based index for searching in product tables.
*
* @package MShop
* @subpackage Index
*/
class MySQL
extends \Aimeos\MShop\Index\Manager\Standard
implements \Aimeos\MShop\Index\Manager\Iface
{
/**
* Creates a search object and optionally sets base criteria.
*
* @param boolean $default Add default criteria
* @return \Aimeos\MW\Criteria\Iface Criteria object
*/
public function createSearch( $default = false )
{
$dbm = $this->getContext()->getDatabaseManager();
$conn = $dbm->acquire();
$object = new \Aimeos\MW\Criteria\MySQL( $conn );
$dbm->release( $conn );
if( $default === true ) {
$object->setConditions( parent::createSearch( $default )->getConditions() );
}
return $object;
}
}