client = $client; } /** * @throws PipedriveClientException * @throws PipedriveHttpClientException * @throws PipedriveConfigurationException * @throws PipedriveMetaException * * @return PipedriveServerResponseInterface */ public function getProperties(): PipedriveServerResponseInterface { return $this->client->read('getPersonFields'); } /** * @param int $id * * @throws PipedriveClientException * @throws PipedriveConfigurationException * @throws PipedriveHttpClientException * @throws PipedriveMetaException * * @return PipedriveServerResponseInterface */ public function getProperty(int $id): PipedriveServerResponseInterface { return $this->client->read('getOnePersonField', [], [$id]); } /** * @throws PipedriveClientException * @throws PipedriveConfigurationException * @throws PipedriveHttpClientException * @throws PipedriveMetaException * @throws PipedrivePersonPropertyServiceException * * @return array */ public function getPdLeadStatus(): array { $response = $this->getProperty(9039); if ($response->getStatusCode() !== 200) { throw new PipedrivePersonPropertyServiceException($response->getError()); } if (($data = $response->getData()) && array_key_exists('options', $data)) { return $data['options']; } return []; } }