Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 1f1aa89

Browse files
committed
Merge pull request #46 from Keops92/zend-validator-32
Let AbstractDb implement AdapterAwareInterface
2 parents fd2a1c8 + 1e58715 commit 1f1aa89

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/Db/AbstractDb.php

100644100755
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use Traversable;
1313
use Zend\Db\Adapter\Adapter as DbAdapter;
14+
use Zend\Db\Adapter\AdapterAwareTrait;
1415
use Zend\Db\Sql\Select;
1516
use Zend\Db\Sql\Sql;
1617
use Zend\Db\Sql\TableIdentifier;
@@ -23,6 +24,8 @@
2324
*/
2425
abstract class AbstractDb extends AbstractValidator
2526
{
27+
use AdapterAwareTrait;
28+
2629
/**
2730
* Error constants
2831
*/
@@ -64,13 +67,6 @@ abstract class AbstractDb extends AbstractValidator
6467
*/
6568
protected $exclude = null;
6669

67-
/**
68-
* Database adapter to use. If null isValid() will throw an exception
69-
*
70-
* @var \Zend\Db\Adapter\Adapter
71-
*/
72-
protected $adapter = null;
73-
7470
/**
7571
* Provides basic configuration for use with Zend\Validator\Db Validators
7672
* Setting $exclude allows a single record to be excluded from matching.
@@ -166,8 +162,7 @@ public function getAdapter()
166162
*/
167163
public function setAdapter(DbAdapter $adapter)
168164
{
169-
$this->adapter = $adapter;
170-
return $this;
165+
return $this->setDbAdapter($adapter);
171166
}
172167

173168
/**

0 commit comments

Comments
 (0)