# classes/phing/Target.php

The Target component. Carries all required target data. Implements the abstract class {@link TaskContainer}

@author Andreas Aderhold andi@binarycloud.com

access
  public
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing
see
  \TaskContainer
version
  $Revision: 915 $ $Date: 2010-10-12 04:30:52 +0200 (Tue, 12 Oct 2010) $

## \Target
jump to top

The Target component. Carries all required target data. Implements the abstract class {@link TaskContainer}

@author Andreas Aderhold andi@binarycloud.com

Implements
  \TaskContainer
see
  \TaskContainer
access
  public
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing
version
  $Revision: 915 $ $Date: 2010-10-12 04:30:52 +0200 (Tue, 12 Oct 2010) $

### Properties

`$children= 'array'`

holds objects of children of this target

Default value `array` Details

Type

`$dependencies= 'array'`

dependencies

Default value `array` Details

Type

`$description= ''`

description of this target

Details

Type

`boolean $hidden= 'false'`

Whether to hide target in targets list (-list -p switches)

Default value `false` Details

Type
  boolean

`$ifCondition= ''`

the if cond. from xml

Details

Type

`$name= ''`

name of target

Details

Type

`$project= ''`

reference to project

Details

Type

`$unlessCondition= ''`

the unless cond. from xml

Details

Type

### Methods

`addDataType( $rtc ) :`
Adds a runtime configurable element to the list of this targets child elements.

@param object The RuntimeConfigurabel object

Parameters

Name | Type | Description
--- | --- | ---
$rtc |  |

Details

access
  public

`addDependency( $dependency ) :`
Adds a singular dependent target name to the list

@param string The dependency target to add

Parameters

Name | Type | Description
--- | --- | ---
$dependency |  |

Details

access
  public

`addTask( $task ) :`
Adds a task element to the list of this targets child elements

@param object The task object to add

Parameters

Name | Type | Description
--- | --- | ---
$task |  |

Details

access
  public

`getDependencies( ) :`
Returns reference to indexed array of the dependencies this target has.

@return array Referece to target dependencoes

`getDescription( ) :`
Returns the description of this target.

@return string The description text of this target

`getHidden( ) : boolean`
Get target status. If true, target does not come in phing -list
Returns

Type | Description
--- | ---
boolean |

`getName( ) :`
Returns name of this target.

@return string The name of the target

Details

access
  public

`getProject( ) :`
Returns reference to current project

@return Project Reference to current porject object

`getTasks( ) : array`
Returns an array of all tasks this target has as childrens.

The task objects are copied here. Don't use this method to modify task objects.

Returns

Type | Description
--- | ---
array |

`isHidden( ) : boolean`
Alias for getHidden()
Returns

Type | Description
--- | ---
boolean |

`main( ) :`
The entry point for this class. Does some checking, then processes and performs the tasks for this target.
`performTasks( ) :`
Performs the tasks by calling the main method of this target that actually executes the tasks.

This method is for ZE2 and used for proper exception handling of task exceptions.

`setDepends( $depends ) :`
Sets the target dependencies from xml

@param string $depends Comma separated list of targetnames that depend on this target

Parameters

Name | Type | Description
--- | --- | ---
$depends |  |

Details

throws

`setDescription( $description ) :`
Sets a textual description of this target.

@param string The description text

Parameters

Name | Type | Description
--- | --- | ---
$description |  |

`setHidden( $flag ) : \Target`
Set target status. If true, target does not come in phing -list
Parameters

Name | Type | Description
--- | --- | ---
$flag |  |

Returns

Type | Description
--- | ---
\Target |

`setIf( $property ) :`
Set the if-condition from the XML tag, if any. The property name given as parameter must be present so the if condition evaluates to true

@param string The property name that has to be present

Parameters

Name | Type | Description
--- | --- | ---
$property |  |

Details

access
  public

`setName( $name ) :`
Sets the name of the target

@param string Name of this target

Parameters

Name | Type | Description
--- | --- | ---
$name |  |

`setProject( $project ) :`
References the project to the current component.

@param Project The reference to the current project

Parameters

Name | Type | Description
--- | --- | ---
$project |  |

`setUnless( $property ) :`
Set the unless-condition from the XML tag, if any. The property name given as parameter must be present so the unless condition evaluates to true

@param string The property name that has to be present

Parameters

Name | Type | Description
--- | --- | ---
$property |  |

Details

access
  public

`testIfCondition( ) :`
Tests if the property set in ifConfiditon exists.

@return boolean `true` if the property specified in `$this->ifCondition` exists; `false` otherwise

`testUnlessCondition( ) :`
Tests if the property set in unlessCondition exists.

@return boolean `true` if the property specified in `$this->unlessCondition` exists; `false` otherwise

`toString( ) :`
Returns a string representation of this target. In our case it simply returns the target name field

@return string The string representation of this target

Documentation was generated by DocBlox 0.13.1.