Answer the question
In order to leave comments, you need to log in
FZ2 PHP5 implicit inheritance?
namespace Album\Model;
use Zend\Db\TableGateway\TableGateway;
class AlbumTable
{
protected $tableGateway;
public function __construct(TableGateway $tableGateway)
{
$this->tableGateway = $tableGateway;
}
public function fetchAll()
{
$resultSet = $this->tableGateway->select();
return $resultSet;
}
Answer the question
In order to leave comments, you need to log in
When creating an AlbumTable object, an object with the TableGateway interface is passed through the constructor and stored in the $tableGateway property. The passed object contains the select() method. When the fetchAll() method is called, the created object delegates the task to the object passed through the constructor with the TableGateway type. I advise you to look at the decorator
A
pattern in this book.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question