The Wayback Machine - https://web.archive.org/web/20200917183854/https://github.com/ScullWM/InboxSearch
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

readme.md

InboxSearch

Search operators library. See more from Gmail: https://support.google.com/mail/answer/7190?hl=en

Supported operators

  • Filename (string)
  • Size (integer - convert string in bytes)
  • Has (string)
  • From (string)
  • To (string)
  • Subject (string)
  • Label (string)
  • Delivered To (string)
  • After (\DateTime)
  • Before (\DateTime)
  • Older (\DateTime)
  • Newer (\DateTime)
  • In (string)

How to use

$term = 'from:thomas@scullwm.com forum';
$factory = new InboxSearchFactory($term);

//  return InboxSearchInterface
$inboxSearch = $factory->process();

$from    = $inboxSearch->getFrom(); // thomas@scullwm.com
$keyword = $inboxSearch->getKeyword(); // array('from' => 'forum')

$fromKeyword = $inboxSearch->getKeywordFor(InboxSearchInterface::FILTER_FROM); // forum

Create your own filter

Filter must implement FilterInterface. Then register the filter in your factory instance

$factory = new InboxSearchFactory($term);

$myFilterParserFqcn = 'Swm\InboxSearch\FilterModel\MyCustomFilter';
$factory->addFilterParser($myFilterParserFqcn);

Tests

php composer install --dev
bin/atoum -d tests/units

About

Search operators library for your project like Gmail search

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.