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

Let AbstractDb implement AdapterAwareInterface #46

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/Db/AbstractDb.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Traversable;
use Zend\Db\Adapter\Adapter as DbAdapter;
use Zend\Db\Adapter\AdapterAwareTrait;
use Zend\Db\Sql\Select;
use Zend\Db\Sql\Sql;
use Zend\Db\Sql\TableIdentifier;
Expand All @@ -23,6 +24,8 @@
*/
abstract class AbstractDb extends AbstractValidator
{
use AdapterAwareTrait;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is of no use unless you also implement AdapterAwareInterface. I'll add that when merging.


/**
* Error constants
*/
Expand Down Expand Up @@ -64,13 +67,6 @@ abstract class AbstractDb extends AbstractValidator
*/
protected $exclude = null;

/**
* Database adapter to use. If null isValid() will throw an exception
*
* @var \Zend\Db\Adapter\Adapter
*/
protected $adapter = null;

/**
* Provides basic configuration for use with Zend\Validator\Db Validators
* Setting $exclude allows a single record to be excluded from matching.
Expand Down Expand Up @@ -166,8 +162,7 @@ public function getAdapter()
*/
public function setAdapter(DbAdapter $adapter)
{
$this->adapter = $adapter;
return $this;
return $this->setDbAdapter($adapter);
}

/**
Expand Down