github dereuromark/cakephp-ide-helper 0.12.4

latest releases: 2.2.3, 1.20.0, 2.2.2...
5 years ago

Improvements

Added HABTM annotations for pivot table and its Table class relation.

For BelongsToMany relationships this will add typehinting/clickability for the pivot table and its Table class:

// FeaturesTable
        $this->belongsToMany('DependingFeatures', [
            'foreignKey' => 'feature_id',
            'className' => 'Features',
            'targetForeignKey' => 'depending_feature_id',
            'joinTable' => 'features_features',
            'propertyName' => 'depending_features',
        ]);
        $this->belongsToMany('Modules', [
            'foreignKey' => 'feature_id',
            'targetForeignKey' => 'module_id',
            'through' => 'FeaturesModules',
            'joinTable' => 'features_modules',
            'propertyName' => 'modules',
        ]);

now adds

 * @property \App\Model\Table\FeaturesFeaturesTable|\Cake\ORM\Association\HasMany $FeaturesFeatures
 * @property \App\Model\Table\FeaturesModulesTable|\Cake\ORM\Association\HasMany $FeaturesModules
 */
class FeaturesTable extends Table

or at least basic Cake\ORM\Table class for chaining and querying on the pivot table as in

$this->Features->FeaturesModules->find()->contain(['Modules', 'Features']);
// or
$this->Features->FeaturesFeatures->find()->contain(['DependingFeatures', 'Features']);

Note one time through and one time auto-calculation alias.

habtm

Don't miss a new cakephp-ide-helper release

NewReleases is sending notifications on new releases.