# 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

Package: phing

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
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
  n/a

`$dependencies= 'array()'`

dependencies

Default value `array()`Details

Type
  n/a

`$description= ''`

description of this target

Details

Type
  n/a

`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

Default value`""`Details

Type
  n/a

`$name= ''`

name of target

Details

Type
  n/a

`$project= ''`

reference to project

Details

Type
  n/a

`$unlessCondition= '""'`

the unless cond. from xml

Default value`""`Details

Type
  n/a

### Methods

`addDataType( $rtc ) : void`

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 ) : void`

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 ) : void`

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( ) : void`

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

@return array Referece to target dependencoes

`getDescription( ) : void`

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( ) : void`

Returns name of this target.

@return string The name of the target

Details

Access
  public

`getProject( ) : void`

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 | Task[]

`isHidden( ) : boolean`

Alias for getHidden()

Returns

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

`main( ) : void`

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

`performTasks( ) : void`

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 ) : void`

Sets the target dependencies from xml

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

Parameters

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

Throws

Exception | Description
--- | ---
\BuildException |

`setDescription( $description ) : void`

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 ) : void`

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 ) : void`

Sets the name of the target

@param string Name of this target

Parameters

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

`setProject( $project ) : void`

References the project to the current component.

@param Project The reference to the current project

Parameters

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

`setUnless( $property ) : void`

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( ) : void`

Tests if the property set in ifConfiditon exists.

@return boolean

    true

if the property specified in

    $this->ifCondition

exists;

    false

otherwise

`testUnlessCondition( ) : void`

Tests if the property set in unlessCondition exists.

@return boolean

    true

if the property specified in

    $this->unlessCondition

exists;

    false

otherwise

`toString( ) : void`

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.17.1.