# ConditionTask

Extends \ConditionBase

<condition> task as a generalization of <available>

This task supports boolean logic as well as pluggable conditions to decide, whether a property should be set.

This task does not extend Task to take advantage of ConditionBase.

author | Andreas Aderhold andi@binarycloud.com
copyright | 2001,2002 THYRELL. All rights reserved
version | $Id: 6c015291a1baa566c81811171f8dc3765d23ec83 $
package | phing.tasks.system

### Methods

## __construct

    __construct( $taskName = 'component')

inherited

### Arguments

#### $taskName

``

## addAvailable

    addAvailable(\AvailableTask $a) : void

inherited

### Arguments

#### $a

`\AvailableTask`

## countConditions

    countConditions() : integer

inherited

### Response

`integer`

## createAnd

    createAnd() : \AndCondition

inherited

### Response

`\AndCondition`

## createContains

    createContains() : \ContainsCondition

inherited

### Response

`\ContainsCondition`

## createEquals

    createEquals() : \EqualsCondition

inherited

### Response

`\EqualsCondition`

## createFilesMatch

    createFilesMatch()

inherited

## createHasFreeSpace

    createHasFreeSpace()

inherited

## createHttp

    createHttp()

inherited

## createIsFailure

    createIsFailure()

inherited

## createIsFalse

    createIsFalse() : \IsFalseCondition

inherited

### Response

`\IsFalseCondition`

## createIsFileSelected

    createIsFileSelected()

inherited

## createIsPropertyFalse

    createIsPropertyFalse() : \IsPropertyFalseCondition

inherited

### Response

`\IsPropertyFalseCondition`

## createIsPropertyTrue

    createIsPropertyTrue() : \IsPropertyTrueCondition

inherited

### Response

`\IsPropertyTrueCondition`

## createIsSet

    createIsSet() : \IsSetCondition

inherited

### Response

`\IsSetCondition`

## createIsTrue

    createIsTrue() : \IsTrueCondition

inherited

### Response

`\IsTrueCondition`

## createMatches

    createMatches()

inherited

## createNot

    createNot() : \NotCondition

inherited

### Response

`\NotCondition`

## createOr

    createOr() : \OrCondition

inherited

### Response

`\OrCondition`

## createOs

    createOs() : \OsCondition

inherited

### Response

`\OsCondition`

## createPhingVersion

    createPhingVersion()

inherited

## createReferenceExists

    createReferenceExists() : \ReferenceExistsCondition

inherited

### Response

`\ReferenceExistsCondition`

## createSocket

    createSocket()

inherited

## createVersionCompare

    createVersionCompare()

inherited

## createXor

    createXor() : \XorCondition

inherited

### Response

`\XorCondition`

## Creates the object for the child element

    customChildCreator(string $elementName, \Project $project) : \Condition

inherited

throws |

### Arguments

#### $elementName

`string`

the name of the element that has been requested

#### $project

`\Project`

The project the element is in

### Response

`\Condition`

## getConditions

    getConditions() : array<mixed,\Condition>

inherited

### Response

`array<mixed,\Condition>`

## Required for IteratorAggregate

    getIterator()

inherited

## Returns a reference to current project

    getProject() : \Project

inherited

### Response

`\Project`

Reference to current porject object

## Returns the name to use in logging messages.

    getTaskName() : string

inherited

### Response

`string`

the name to use in logging messages.

## Logs a message with the given priority.

    log(string $msg, integer $level = \Project::MSG_INFO) : void

inherited

### Arguments

#### $msg

`string`

The message to be logged.

#### $level

`integer`

The message's priority at this message should have

## See whether our nested condition holds and set the property.

    main() : void

throws |

## The value for the property to set, if condition evaluates to false.

    setElse(string $v)

If this attribute is not specified, the property will not be set.

### Arguments

#### $v

`string`

## References the project to the current component.

    setProject(\Project $project) : void

inherited

### Arguments

#### $project

`\Project`

The reference to the current project

## The name of the property to set. Required.

    setProperty(string $p) : void

### Arguments

#### $p

`string`

## Sets the name to use in logging messages.

    setTaskName(string $name)

inherited

### Arguments

#### $name

`string`

The name to use in logging messages. Should not be `null`.

## The value for the property to set. Defaults to "true".

    setValue(string $v) : void

### Arguments

#### $v

`string`

### Properties

## property

    property : string

var |

### Type(s)

`string`

## value

    value : string

var |

### Type(s)

`string`

## alternative

    alternative : string

var |

### Type(s)

`string`

## conditions

    conditions :

inherited

### Type(s)

``

## taskName

    taskName : string

inherited

var |

### Type(s)

`string`

## Holds a reference to the project that a project component (a task, a target, etc.) belongs to

    project : \Project

inherited

var | A reference to the current project instance

### Type(s)

`\Project`