mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-09-04 04:35:33 +01:00
Add basic methods
This commit is contained in:
parent
c5b260f298
commit
792bfda017
3 changed files with 175 additions and 1 deletions
52
src/Filter.php
Normal file
52
src/Filter.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
namespace Opdavies\GmailFilterBuilder;
|
||||
|
||||
class Filter
|
||||
{
|
||||
public function has($value)
|
||||
{
|
||||
return ['hasTheWord' => $value];
|
||||
}
|
||||
|
||||
public function from()
|
||||
{
|
||||
return ['from' => func_get_args()];
|
||||
}
|
||||
|
||||
public function label($label)
|
||||
{
|
||||
return ['label' => $label];
|
||||
}
|
||||
|
||||
public function archive()
|
||||
{
|
||||
return ['shouldArchive' => 'true'];
|
||||
}
|
||||
|
||||
public function labelAndArchive($label)
|
||||
{
|
||||
return $this->label($label) + $this->archive();
|
||||
}
|
||||
|
||||
public function spam()
|
||||
{
|
||||
return [
|
||||
'shouldSpam' => 'true',
|
||||
'shouldNeverSpam' => 'false',
|
||||
];
|
||||
}
|
||||
|
||||
public function neverSpam()
|
||||
{
|
||||
return [
|
||||
'shouldSpam' => 'false',
|
||||
'shouldNeverSpam' => 'true',
|
||||
];
|
||||
}
|
||||
|
||||
public function trash()
|
||||
{
|
||||
return ['shouldTrash' => 'true'];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue