zendframework / tutorials

Tutorials for Zend Framework
https://docs.zendframework.com/tutorials/
30 stars 69 forks source link

AlbumTableGateway setup missing in the tutorial #74

Open joni- opened 7 years ago

joni- commented 7 years ago

Hi,

I am setting up a database for Zend 3 and browsing the tutorial. It seems like there is a missing piece in Using ServiceManager to configure the table gateway and inject into the AlbumTable. In the AlbumTable factory a Model\AlbumTableGateway::class is used but there is no mention of that class before.

Got it working by creating an empty AlbumTableGateway class extending AbstractTableGateway but it would be good to mention about it in the tutorial.

froschdesign commented 7 years ago

@joni- This class is not required, because in the module class a closure handle the creation of the service. The name for Model\AlbumTableGateway::class works in PHP even though the class does not exist.

froschdesign commented 6 years ago

The current usage of the class names is confusing. We should update the tutorial with a better solution.