for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://github.com/flipbox/hubspot/blob/master/LICENSE.md
* @link https://github.com/flipbox/hubspot
*/
namespace Flipbox\HubSpot\Criteria;
use Flipbox\HubSpot\Resources\CompanyContacts;
use Psr\Http\Message\ResponseInterface;
* @author Flipbox Factory <[email protected]>
* @since 2.0.0
class CompanyContactsCriteria extends AbstractCriteria
{
use ConnectionTrait,
CacheTrait,
IdAttributeTrait;
* @var string|null
protected $contactId;
* @return string
* @throws \Exception
public function getContactId(): string
if (null === ($id = $this->findContactId())) {
throw new \Exception("Invalid Contact Id");
}
return (string)$id;
* @return string|null
public function findContactId()
return $this->contactId;
* @param string|null $id
* @return $this
public function setContactId(string $id = null)
$this->contactId = $id;
return $this;
* @param array $criteria
* @param array $config
* @return ResponseInterface
public function all(array $criteria = [], array $config = []): ResponseInterface
$this->populate($criteria);
return CompanyContacts::all(
$this->getId(),
$this->getConnection(),
$this->getCache(),
$this->getLogger(),
$config
);
public function add(array $criteria = [], array $config = []): ResponseInterface
return CompanyContacts::add(
$this->getContactId(),
public function remove(array $criteria = [], array $config = []): ResponseInterface
return CompanyContacts::remove(