ZF2: use the MetadataFeature with AbstractTableGateway

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ZF2: use the MetadataFeature with AbstractTableGateway

Ralf Eggert
Hi,

I want to use the MetadataFeature with the AbstractTableGateway. I found
an example for TableGateway here:

https://github.com/ralphschindler/Zend_Db-Examples/blob/master/example-18.php

But I did not manage to get in run with my class that extends
AbstractTableGateway. This line is called in the __construct() method:

    $this->featureSet = new Feature\FeatureSet(array(
    new MetadataFeature()));

But results in the following error.

---------------------------------------------------------------------
Catchable fatal error: Argument 1 passed to
Zend\Db\RowGateway\Feature\FeatureSet::addFeature() must be an instance
of Zend\Db\RowGateway\Feature\AbstractFeature, instance of
Zend\Db\TableGateway\Feature\MetadataFeature given, called in
/home/devhost/zf2domain/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Feature/FeatureSet.php
on line 68 and defined in
/home/devhost/zf2domain/vendor/zendframework/zendframework/library/Zend/Db/RowGateway/Feature/FeatureSet.php
on line 73
---------------------------------------------------------------------

Please advise.

Thanks and best regards,

Ralf

--
Ralf Eggert
Geschäftsführer

Travello GmbH
An der Eiche 15
25421 Pinneberg

Geschäftsführer: Ralf Eggert
Amtsgericht Pinneberg HRB 6112 PI

Tel: 04101/8529401
Fax: 04101/8529402
E-Mail: [hidden email]
Web: http://www.travello.de

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: ZF2: use the MetadataFeature with AbstractTableGateway

Ralf Eggert
Hi,

ok, I mixed up the namepaces and used the

  Zend\Db\RowGateway\Feature

instead of the

  Zend\Db\TableGateway\Feature

fixed that, but still get an error:

Fatal error: Call to undefined method
Zend\Db\Metadata\Object\ConstraintObject::getKeys() in
/home/devhost/zf2domain/vendor/zendframework/zendframework/library/Zend/Db/TableGateway/Feature/MetadataFeature.php
on line 78

Please advise!

Regards,

Ralf

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]