Removed _ for protected property in data mapper

This commit is contained in:
eddiejaoude
2013-08-31 10:16:27 +01:00
parent e9a72d3ad0
commit 20cfe16b12

View File

@@ -29,11 +29,11 @@ class UserMapper
/** /**
* @var DBAL * @var DBAL
*/ */
protected $_adapter; protected $adapter;
public function __construct(DBAL $dbLayer) public function __construct(DBAL $dbLayer)
{ {
$this->_adapter = $dbLayer; $this->adapter = $dbLayer;
} }
/** /**
@@ -54,10 +54,10 @@ class UserMapper
/* if no ID specified create new user else update the one in the Database */ /* if no ID specified create new user else update the one in the Database */
if (null === ($id = $user->getUserId())) { if (null === ($id = $user->getUserId())) {
unset($data['userid']); unset($data['userid']);
$this->_adapter->insert($data); $this->adapter->insert($data);
return true; return true;
} else { } else {
$this->_adapter->update($data, array('userid = ?' => $id)); $this->adapter->update($data, array('userid = ?' => $id));
return true; return true;
} }
} }
@@ -72,7 +72,7 @@ class UserMapper
*/ */
public function findById($id) public function findById($id)
{ {
$result = $this->_adapter->find($id); $result = $this->adapter->find($id);
if (0 == count($result)) { if (0 == count($result)) {
throw new \InvalidArgumentException("User #$id not found"); throw new \InvalidArgumentException("User #$id not found");
} }
@@ -89,7 +89,7 @@ class UserMapper
*/ */
public function findAll() public function findAll()
{ {
$resultSet = $this->_adapter->findAll(); $resultSet = $this->adapter->findAll();
$entries = array(); $entries = array();
foreach ($resultSet as $row) { foreach ($resultSet as $row) {