How to add documentation for my functions in Netbeans PHP?

Lenin Raj Rajasekaran picture Lenin Raj Rajasekaran · Dec 5, 2010 · Viewed 30.8k times · Source

I tried the following,

/*
 * addRelationship
 *
 * Adds a relationship between two entities using the given relation type.
 *
 * @param fromKey the original entity
 * @param toKey the referring entity
 * @param relationTypeDesc the type of relationship
 */

function addRelationship($fromKey, $toKey, $relationTypeDesc) {
    $relationTypeKey = $this->getRelationTypeKey($relationTypeDesc);

But, when I tried to use it in another place, it says PHPDoc not found.

alt text

Any Ideas on how to get this to work in NetBeans PHP?

UPDATE :

The following is the updated syntax which will work in NetBeans PHP -

/** 
 * addRelationship
 *
 * Adds a relationship between two entities using the given relation type.
 *
 * @param integer $fromKey the original entity
 * @param integet $toKey the referring entity
 * @param string $relationTypeDesc the type of relationship
 */

function addRelationship($fromKey, $toKey, $relationTypeDesc) {

Answer

Pekka picture Pekka · Dec 5, 2010

You are missing an asterisk * in the first line: Try

/**
 * addRelationship
 *
 * Adds a relationship between two entities using the given relation type.
 *
 * @param fromKey the original entity
 * @param toKey the referring entity
 * @param relationTypeDesc the type of relationship
 */