# types/selectors/PresentSelector.php

Selector that filters files based on whether they appear in another directory tree. It can contain a mapper element, so isn't available as an ExtendSelector (since those parameters can't hold other elements).

Author
  Hans Lellelid (Phing)
Author
  Bruce Atherton (Ant)
Package
  phing.types.selectors

## \PresentSelector
jump to top

Package: phing\types\selectors

Selector that filters files based on whether they appear in another directory tree. It can contain a mapper element, so isn't available as an ExtendSelector (since those parameters can't hold other elements).

Parent(s)
  \BaseSelector < \DataType < \ProjectComponent
Author
  Hans Lellelid (Phing)
Author
  Bruce Atherton (Ant)

### Properties

`$destmustexist= 'true'`
Default value `true` Details

Type
  n/a

`$filePresence= 'array("srconly"'`
static
Default value `array("srconly"`Details

Type
  n/a

`$map= 'null'`
Default value `null` Details

Type
  n/a

`$mapperElement= 'null'`
Default value `null` Details

Type
  n/a

`$targetdir= 'null'`
Default value `null` Details

Type
  n/a

### Methods

`circularReference( ) : void`

`createMapper( ) : void`

Defines the FileNameMapper to use (nested mapper element).

Throws

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

`dieOnCircularReference( ) : void`

`getCheckedRef( ) : void`

`getDescription( ) : void`

`getError( ) : void`

`getProject( ) : void`

`isReference( ) : void`

`isSelected( \basedir $basedir, \filename $filename, \file $file ) : \whether`

The heart of the matter. This is where the selector gets to decide on the inclusion of a file in a particular fileset.

Parameters

Name | Type | Description
--- | --- | ---
$basedir | \basedir | the base directory the scan is being done from
$filename | \filename | is the name of the file to check
$file | \file | is a PhingFile object the selector can use

Returns

Type | Description
--- | ---
\whether | the file should be selected or not

`log( ) : void`

`noChildrenAllowed( ) : void`

`parsingComplete( ) : void`

`setDescription( ) : void`

`setError( ) : void`

`setPresent( string $fp ) : void`

This sets whether to select a file if its dest file is present.

It could be a

    negate

boolean, but by doing things this way, we get some documentation on how the system works. A user looking at the documentation should clearly understand that the ONLY files whose presence is being tested are those that already exist in the source directory, hence the lack of a

    destonly

option.

Parameters

Name | Type | Description
--- | --- | ---
$fp | string | An attribute set to either `srconly` or `both`.

`setProject( ) : void`

`setRefid( ) : void`

`setTargetdir( \targetdir $targetdir ) : void`

The name of the file or directory which is checked for matching files.

Parameters

Name | Type | Description
--- | --- | ---
$targetdir | \targetdir | the directory to scan looking for matching files.

`toString( ) : void`

`tooManyAttributes( ) : void`

`validate( ) : void`

`verifySettings( ) : void`

Checks to make sure all settings are kosher. In this case, it means that the targetdir attribute has been set and we have a mapper.

Documentation was generated by DocBlox 0.17.1.