I'm using Zend Studio for Eclipse (Linux), and I'm trying to generate getter and setters methods in a PHP class.
I try to do this: http://files.zend.com/help/Zend-Studio-Eclipse-Help/creating_getters_and_setters.htm
but I haven't "Generate Getters and Setters" option in Source Menu, it's missed!
Could u help me? Thanks!
Like Omnipotent say, you can use templates to do this. Here what I use:
/**
* #var ${PropertyType}
*/
private $$m${PropertyName};
${cursor}
/**
* Getter for ${PropertyName}
*
* #author ${user}
* #since ${date} ${time}
* #return ${PropertyType} private variable $$m_${PropertyName}
*/
public function get${PropertyName}()
{
return $$this->m_${PropertyName};
}
/**
* Setter for ${PropertyName}
*
* #author ${user}
* #since ${date} ${time}
* #param ${PropertyType} $$Value
*/
public function set${PropertyName}($$Value)
{
$$this->m_${PropertyName} = $$Value;
}
To create the template just go to the preferences. Then in PHP/Templates you will have your list of templates.
It has to be there under the menu - source in Eclipse. Could you provide a snapshot of your Eclipse to verify.
EDITED: I guess it is not possible to generate getters and setters automatically in your version, though you would be able to create templates for the same and use it as per your requirements. Omnipotent (0 seconds ago)
I haven't seen anyone mention the Zend Studio ctrl+3 shortcut/search:
ctrl+3 and search...
I type "setters", and first option on the menu is the "Generate Getters and Setters" wizard.
If there is a 'Refactor' menu, check in there as well. A lot of those methods have been moved to the 'Refactor' menu in later versions of eclipse and if Zend has updated recently and not updated it's documentation, the items may have encountered an undocumented move.
#Omnipotent It's Zend Studio v6.01, "generate getters and setters" feature should be available. I can see doc about it in Help Contents.
By the way i'll try updating to v6.1
Thanks anyway!
EDITED: Templates and Code Assist works fine but are not usefull as "Generate getters and setters".
Related
I would like to know if there is any way to get all the scripts parameters when you create a new script (SuiteScript 2.0) using VS Code.
I'm aware that it is possible when using Eclipse IDE but I do really would like to keep using VS Code as I'm already using for Python and JavaScript.
This is what I'm looking for:
/**
* Function definition to be triggered before record is loaded.
*
* Task #5060 : calculate PO Spent Amount and Balance in realtime
*
* #param {Object} scriptContext
* #param {Record} scriptContext.newRecord - New record
* #param {Record} scriptContext.oldRecord - Old record
* #param {string} scriptContext.type - Trigger type
* #Since 2015.2
*/
BTW, I'm already using VS Code Intelisense and NetSuite Uploader extensions.
Thanks
At the time of writing, there are no official plugins from Netsuite for VS Code, only Eclipse & Webstorm are available. However, there is an unofficial plugin from Head-in-the-Cloud that might do what you're after.
I have a javascript library for communicating with server APIS, written in modern ECMAScript.
It is fully documented with JSDoc comments:
/**
* #class - TODOS API Client class
*/
class todosApi {
/**
* Gets Todos, given the parameters
* #param {number} personId
* #param {number} [year]
* #param {number} [month]
* #param {number} [todoTypeId]
* #returns {Object} - api response object, data will be array of todos
*/
fetchTodos = async (....
}
When using this API in the unit tests in this project, in Visual Studio code, I have excellent intellisense from these comments, and it's a beautiful thing.
However, this library is used by/referenced in a separate react application created with create-react-app. When I run this through babel to transpile into a format that is consumable by my create-react-app app, it ends up like this:
/**
* #class - TODOS API Client class
*/
class todosApi {
_defineProperty(this, "fetchTodos", async (personId, eventYear, eventMonth, todoTypeId) => {
}
And I lose my intellisense for fetchTodos, and actually the class itself because of how it is exported in and index.js file. babel does have the option to include comments by default, however the class gets a little mangled in transpiling and loses some comments.
Is there any way to transpile and still preserve this intellisense for VS Code?
Use tsd-jsdoc to create a types.d.ts file.
In your package.json add a script to run ...
jsdoc -r src -t node_modules/tsd-jsdoc/dist -d lib
And set types to lib/types.d.js.
Include that script as part of prepublishOnly so it runs before every npm publish.
When I select Web/Functions in the menu of typo3 cms 9.5.4 backend, I get this error:
Advanced functions
No modules have been registered. Please contact your system administrator.
I am the system administrator. I can't find anywhere how to register modules. How do I register any modules?
Like Peter wrote, the Extension func was removed from core, is actually not marked as compatible with version 9.5. and should avoided to use further more.
But follow two files will help you to register your own module:
ext/extension/ext_tables.php
// Module wizard
if (TYPO3_MODE === 'BE') {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
'web_func',
\Vendor\Extension\MyModuleFunction::class,
null,
'LLL:EXT:extension/Resources/Private/Language/locallang_module.xlf:mymodulefunction'
);
}
ext/extension/Classes/MyModuleFunction.php
<?php
namespace Vendor\Extension;
class MyModuleFunction
{
/**
* Initialize the object
*
* #param \object $pObj A reference to the parent (calling) object
* #throws \RuntimeException
*/
public function init($pObj)
{
// Required method
}
/**
* Checking for first level external objects
*/
public function checkExtObj()
{
// Required method
}
/**
* Main function creating the content for the module.
*
* #return string HTML content for the module, actually a "section" made through the parent object in $this->pObj
*/
public function main()
{
return '<h1>My module function</h1>';
}
}
As far as I know, EXT:wizard_crpages and EXT:wizard_sortpages are not maintained anymore in TYPO3 9.x.
EXT:func has been moved to the TYPO3 Extension Repository to preserve the possibility to register your own wizards.
UPDATE:
The possibility to create multiple pages and to sort pages is now available via the context menu in the page tree. Just do a left or right click on the icon in front of any page and choose More options ... from the context menu.
I'm working with Zend Framework 2 and Doctrine 2 and my application has two modules:
Privado (Private)
Publico (Public).
I created an Entity in Public, my first entity in public, and now I'm trying to create her repository using the command:
./vendor/bin/doctrine-module orm:generate-repositories ./module/Publico/src/
And all the repositories from Private module are created but the repository from my new entity in Public module is not created.
So, what happened? What am I doing wrong?
I have found the problem, I have been make a terrible mistake. I don't define correctly the Repository class.
Wrong:
/** #ORM\Entity
* #ORM\Table(name="menu")
* #ORM\Entity(repositoryClass="Privado\Repository\EstadoRepository")
*/
Right:
/** #ORM\Entity
* #ORM\Table(name="menu")
* #ORM\Entity(repositoryClass="Publico\Repository\MenuRepository")
*/
When I type a methods and generate comments via /** enter.
It generates comment like this.
/**
* #param int $weight
* #return \KT_Forbes_Theme_Model
*/
Is the a possibility to auto add #author ?
/**
* #author A good guy
* #param int $weight
* #return \KT_Forbes_Theme_Model
*/
I have to add the #autor manualy for all the method, it is really anoing.
It seems that it is not possible in current NetBeans versions as reported in https://netbeans.org/bugzilla/show_bug.cgi?id=251426. Also there are some related posts about this issue Modify command / template for function commenting in NetBeans. Triggering with "/** + Enter key" or Edit Comment Template in Netbeans PHP 6.8 (this last one does not solve the issue - at least in NetBeans 8.1).
I'm currently fighting with the IDE to include the auto comments with some data cause the comment added looks like:
/**
*
*/
whitout any info included.
This output is given typically for void methods, with no parameters.
i.e. public void parameterMapping()
For methods that have parameters and a return value should look like this:
/**
*
* #param parameter
* #return
*/
private ASTNode recursiveParameterParser(ASTNode parameter)