PHP Class Pop\Filter\Search

Author: Nick Sagona, III ([email protected])
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$case boolean Case search property
$data array Data to search
$delim string Delimiter
$pattern string Search pattern property
$search string Search property

Public Methods

Method Description
__construct ( mixed $data, string $delim = " " ) : Search Constructor
factory ( mixed $data, string $delim = " " ) : Search Static method to instantiate the search filter object and return itself to facilitate chaining methods together.
search ( string $search, boolean $case = false ) : array Method to perform a search over the data and return an array of the results.

Protected Methods

Method Description
searchArray ( string $val ) : string Method to search an array for a string, non-inclusive.

Method Details

__construct() public method

Instantiate the search object.
public __construct ( mixed $data, string $delim = " " ) : Search
$data mixed
$delim string
return Search

factory() public static method

Static method to instantiate the search filter object and return itself to facilitate chaining methods together.
public static factory ( mixed $data, string $delim = " " ) : Search
$data mixed
$delim string
return Search

searchArray() protected method

Method to search an array for a string, non-inclusive.
protected searchArray ( string $val ) : string
$val string
return string

Property Details

$case protected property

Case search property
protected bool $case
return boolean

$data protected property

Data to search
protected array $data
return array

$delim protected property

Delimiter
protected string $delim
return string

$pattern protected property

Search pattern property
protected string $pattern
return string