src/DataListTrait.php
public function filterBy(string $property, $value, string $operator = 'equal'): self
    {
        if (array_search($operator, ['equal', 'notEqual', 'regExp', 'notRegExp', 'startWith', 'notStartWith', 'endWith', 'notEndWith', 'inArray', 'notInArray']) === false) {
            throw new \InvalidArgumentException('Invalid operator (' . $operator . ')');
        }
        $this->internalDataListActions[] = ['filterBy', $property, $value, $operator];
        return $this;
    }
public function filterBy(string $property, $value, string $operator = 'equal'): self
    {
        if (array_search($operator, ['equal', 'notEqual', 'regExp', 'notRegExp', 'startWith', 'notStartWith', 'endWith', 'notEndWith', 'inArray', 'notInArray']) === false) {
            throw new \InvalidArgumentException('Invalid operator (' . $operator . ')');
        }
        $this->internalDataListActions[] = ['filterBy', $property, $value, $operator];
        return $this;
    }
public function filterBy ( string $ property , $ value , string $ operator = 'equal' ) : self { if ( array_search ( $ operator , [ 'equal' , 'notEqual' , 'regExp' , 'notRegExp' , 'startWith' , 'notStartWith' , 'endWith' , 'notEndWith' , 'inArray' , 'notInArray' ] ) === false ) { throw new \ InvalidArgumentException ( 'Invalid operator (' . $ operator . ')' ) ; } $ this -> internalDataListActions [ ] = [ 'filterBy' , $ property , $ value , $ operator ] ; return $ this ; }
Filters the elements of the list by specific property value.

@param string $property The property name.
@param mixed $value The value of the property.
@param string $operator Available values: equal, notEqual, regExp, notRegExp, startWith, notStartWith, endWith, notEndWith, inArray, notInArray.
@return self A reference to the list.
@throws \InvalidArgumentException
Filters the elements of the list by specific property value .