# Target

Implements \TaskContainer

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

author | Andreas Aderhold andi@binarycloud.com
copyright | 2001,2002 THYRELL. All rights reserved
version | $Id: fdff5ad4aee28d30831176c675a76fd0dc823658 $
see |
package | phing

### Methods

## Adds a runtime configurable element to the list of this targets child elements.

    addDataType(\RuntimeConfigurable $rtc)

### Arguments

#### $rtc

`\RuntimeConfigurable`

The RuntimeConfigurable object

## Adds a singular dependent target name to the list

    addDependency(string $dependency)

### Arguments

#### $dependency

`string`

The dependency target to add

## Adds a task element to the list of this targets child elements

    addTask(\Task $task)

### Arguments

#### $task

`\Task`

The task object to add

## Returns reference to indexed array of the dependencies this target has.

    getDependencies() : array

### Response

`array`

Reference to target dependencoes

## Returns the description of this target.

    getDescription() : string

### Response

`string`

The description text of this target

## Get target status. If true, target does not come in phing -list

    getHidden() : boolean

### Response

`boolean`

## getLogSkipped

    getLogSkipped() : boolean|null

### Response

`boolean|null`

## Returns name of this target.

    getName() : string

### Response

`string`

The name of the target

## Returns reference to current project

    getProject() : \Project

### Response

`\Project`

Reference to current porject object

## Returns an array of all tasks this target has as childrens.

    getTasks() : array

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

### Response

`array`

Task[]

## Alias for getHidden()

    isHidden() : boolean

### Response

`boolean`

## The entry point for this class. Does some checking, then processes and performs the tasks for this target.

    main()

## Performs the tasks by calling the main method of this target that actually executes the tasks.

    performTasks()

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

## Sets the target dependencies from xml

    setDepends(string $depends)

throws |

### Arguments

#### $depends

`string`

Comma separated list of targetnames that depend on this target

## Sets a textual description of this target.

    setDescription(string $description)

### Arguments

#### $description

`string`

The description text

## Set target status. If true, target does not come in phing -list

    setHidden(boolean $flag) : \Target

### Arguments

#### $flag

`boolean`

### Response

`\Target`

## 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

    setIf(string $property)

### Arguments

#### $property

`string`

The property name that has to be present

## setLogSkipped

    setLogSkipped( $log)

### Arguments

#### $log

``

## Sets the name of the target

    setName(string $name)

### Arguments

#### $name

`string`

Name of this target

## References the project to the current component.

    setProject(\Project $project)

### Arguments

#### $project

`\Project`

The reference to the current project

## 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

    setUnless(string $property)

### Arguments

#### $property

`string`

The property name that has to be present

## Tests if the property set in ifConfiditon exists.

    testIfCondition() : boolean

### Response

`boolean`

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

## Tests if the property set in unlessCondition exists.

    testUnlessCondition() : boolean

### Response

`boolean`

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

## Returns a string representation of this target. In our case it simply returns the target name field

    toString() : string

### Response

`string`

The string representation of this target

### Properties

## Name of target

    name : string

var |

### Type(s)

`string`

## Dependencies

    dependencies : array

var |

### Type(s)

`array`

## Holds objects of children of this target

    children : array

var |

### Type(s)

`array`

## The if condition from xml

    ifCondition : string

var |

### Type(s)

`string`

## The unless condition from xml

    unlessCondition : string

var |

### Type(s)

`string`

## Description of this target

    description : string

var |

### Type(s)

`string`

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

    hidden : boolean

var |

### Type(s)

`boolean`

## Whether to log message as INFO or VERBOSE if target skipped

    logSkipped : boolean

var |

### Type(s)

`boolean`

## Rreference to project

    project : \Project

var |

### Type(s)

`\Project`