# BuildEvent

Extends \EventObject

Encapsulates a build specific event.

We have three sources of events all handled by this class:

- Project level events
- Target level events
- Task level events

Events are all fired from the project class by creating an event object using this class and passing it to the listeners.

author | Andreas Aderhold andi@binarycloud.com
author | Hans Lellelid hans@xmpl.org
version | $Id: f406bad78fbfd0f905a64e9f8b1933356ecb87b6 $
package | phing

### Methods

## Constructs a prototypical Event.

    __construct( $source)

inherited

throws |

### Arguments

#### $source

``

## Returns the exception that was thrown, if any.

    getException() : \Exception

This field will only be set for "taskFinished", "targetFinished", and "buildFinished" events.

see | \BuildListener::taskFinished() \BuildListener::targetFinished() \BuildListener::buildFinished()

### Response

`\Exception`

## Returns the logging message. This field will only be set for "messageLogged" events.

    getMessage() : string

### Response

`string`

The log message

## Returns the priority of the logging message. This field will only be set for "messageLogged" events.

    getPriority() : integer

### Response

`integer`

The message priority

## Returns the project instance that fired this event.

    getProject() : \Project

The reference to the project instance is set by the constructor if this event was fired from the project class.

### Response

`\Project`

The project instance that fired this event

## The object on which the Event initially occurred.

    getSource()

inherited

## Returns the target instance that fired this event.

    getTarget() : \Target

The reference to the target instance is set by the constructor if this event was fired from the target class.

### Response

`\Target`

The target that fired this event

## Returns the target instance that fired this event.

    getTask() : \Task

The reference to the task instance is set by the constructor if this event was fired within a task.

### Response

`\Task`

The task that fired this event

## Set the exception that was the cause of this event.

    setException( $exception)

### Arguments

#### $exception

``

## Sets the message with details and the message priority for this event.

    setMessage( $message,  $priority)

### Arguments

#### $message

``

#### $priority

``

## Returns a String representation of this EventObject.

    toString()

inherited

### Properties

## A reference to the project

    project : \Project

var |

### Type(s)

`\Project`

## A reference to the target

    target : \Target

var |

### Type(s)

`\Target`

## A reference to the task

    task : \Task

var |

### Type(s)

`\Task`

## The message of this event, if the event is a message

    message : string

var |

### Type(s)

`string`

## The priority of the message

    priority : string

var |
see |

### Type(s)

`string`

## The exception that caused the event, if any

    exception : object

var |

### Type(s)

`object`

## The object on which the Event initially occurred.

    source :

inherited

### Type(s)

``