-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from noweasily/issues/117
Issues/117
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace AmoCRM\AmoCRM\Filters; | ||
|
||
use AmoCRM\Filters\BaseEntityFilter; | ||
|
||
use function is_null; | ||
|
||
class CatalogsFilter extends BaseEntityFilter | ||
{ | ||
/** @var null|string */ | ||
private $type = null; | ||
|
||
/** | ||
* @param null|string $type | ||
* | ||
* @return $this | ||
*/ | ||
public function setType(?string $type): self | ||
{ | ||
$this->type = $type; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return null|string | ||
*/ | ||
public function getType(): ?string | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function buildFilter(): array | ||
{ | ||
$filter = []; | ||
|
||
if (!is_null($this->getType())) { | ||
$filter['type'] = $this->getType(); | ||
} | ||
|
||
return $filter; | ||
} | ||
} |