# classes/phing/BuildEvent.php

Encapsulates a build specific event.

<

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

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

<

p> 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
author
  Hans Lellelid
package
  phing
version
  $Revision: 526 $

## \BuildEvent
jump to top

Encapsulates a build specific event.

<

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

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

<

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

Extends from
  \EventObject
author
  Andreas Aderhold
author
  Hans Lellelid
package
  phing
version
  $Revision: 526 $

### Properties

`object $exception= 'null'`

The execption that caused the event, if any

Default value `null` Details

Type
  object

`string $message= 'null'`

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

Default value `null` Details

Type
  string

`string $priority= 'Project'`

The priority of the message

Default value `Project` Details

Type
  string
see
  \$message

`\Project $project= ''`

A reference to the project

Details

Type
  \Project

`\Target $target= ''`

A reference to the target

Details

Type
  \Target

`\Task $task= ''`

A reference to the task

Details

Type
  \Task

### Methods

`__construct( object $source ) :`
Construct a BuildEvent for a project, task or target source event
Parameters

Name | Type | Description
--- | --- | ---
$source | object | project the project that emitted the event.

`getException( ) : \Exception`
Returns the exception that was thrown, if any.

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

Returns

Type | Description
--- | ---
\Exception |

Details

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

`getMessage( ) : string`
Returns the logging message. This field will only be set for "messageLogged" events.
Returns

Type | Description
--- | ---
string |

`getPriority( ) : integer`
Returns the priority of the logging message. This field will only be set for "messageLogged" events.
Returns

Type | Description
--- | ---
integer |

`getProject( ) : \Project`
Returns the project instance that fired this event.

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

Returns

Type | Description
--- | ---
\Project |

`getTarget( ) : \Target`
Returns the target instance that fired this event.

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

Returns

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

`getTask( ) : \Task`
Returns the target instance that fired this event.

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

Returns

Type | Description
--- | ---
\Task |

`setException( \Exception $exception ) :`
Set the exception that was the cause of this event.
Parameters

Name | Type | Description
--- | --- | ---
$exception | \Exception | The exception that caused the event

`setMessage( string $message, integer $priority ) :`
Sets the message with details and the message priority for this event.
Parameters

Name | Type | Description
--- | --- | ---
$message | string | The string message of the event
$priority | integer | The priority this message should have

Documentation was generated by DocBlox 0.13.1.