[Implemented] Doctrine2: Private => Protected

0 votes
asked Jan 21, 2016 in Solved by ludek.vodicka Skipper developer (140,450 points)
recategorized May 28, 2016 by ludek.vodicka

From email:

Hi there,

This is in regards of Doctrine2/No Framework on OS X:

I am pretty sure at one point I got Skipper to write properties with protected access instead of private. Unfortunately I find no note how to do it, and now having it on a new computer and new install, I am back to private. Obviously I can do a search and replace, but…. was there a way to change it inside of a template. I just did a quick inspection of the framework files in the Show Package Contents but I didn’t find anything.

One issue that actually arises from private is that you use an embeddable in a base class then the database generator will throw an error about the property not existing in the derived classes.

Cheers!

Mario

1 Answer

0 votes
answered Jan 21, 2016 by ludek.vodicka Skipper developer (140,450 points)
 
Best answer

By default there is always private member access because it was recommended by Doctrine2 developers.

In latest version (3.2.5.1278) we prepared a way how to customize this value. It's in test mode so there is no way how to configure it from application or from configuration files and it's necessary to update export scripts.

In case more users will be interested in this option we will add it to configuration files.Here is how to configure it:

It's necessary to edit file Doctrine2.export.osc.

This file is located in InstallationDirector\Configurations\Frameworks directory on windows/linux or inside Skipper.app\Contents\Resources\Configurations\Frameworks on OS X

In function Doctrine2ExportPhpFile on line 126 there is following line:

var xslParams = new Array(); 
//xslParams["variable-access-rights"]  = "protected"; 
MLTools.XslTransformation(fileName, .....

Uncomment line `xslParams["variable-access-rights"] = "protected" and it's done

Note: Please keep in mind that this file will be updated after each application update. Currently it's not possible to store this settings in user-settings. As wrote before, this is experimental feature only

commented Jan 21, 2016 by Mario (190 points)

Works like a charm! Thank you!

commented Jan 21, 2016 by ludek.vodicka Skipper developer (140,450 points)

You're welcome ;-)

commented Feb 16, 2016 by renaatdemuynck (840 points)

Works perfectly! Just be sure tor restart Skipper after changing the config file.

commented Feb 16, 2016 by ludek.vodicka Skipper developer (140,450 points)

Thanks for feedback. Should be sufficient to close and re-open the project but app restart works always.

...