diff --git a/src/Api/Employee.php b/src/Api/Employee.php new file mode 100644 index 0000000..e4d47f3 --- /dev/null +++ b/src/Api/Employee.php @@ -0,0 +1,26 @@ +app); + return $resource->call($request); + } +} +?> diff --git a/src/Model/Employee/RequestEmployeeList.php b/src/Model/Employee/RequestEmployeeList.php new file mode 100644 index 0000000..1b69df0 --- /dev/null +++ b/src/Model/Employee/RequestEmployeeList.php @@ -0,0 +1,169 @@ +firstName; + } + + /** + * Gets lastName value. + * + * @return string + */ + public function getLastName() + { + return $this->lastName; + } + + /** + * Gets employeeNumber value. + * + * @return string + */ + public function getEmployeeNumber() + { + return $this->employeeNumber; + } + + /** + * Sets employeeNumber variable. + * + * @param string $employeeNumber + * + * @return $this + */ + public function setEmployeeNumber($employeeNumber) + { + $this->employeeNumber = $employeeNumber; + return $this; + } + + /** + * Gets allowInformationRegistration value. + * + * @return bool + */ + public function getAllowInformationRegistration() + { + return $this->allowInformationRegistration; + } + + /** + * Sets allowInformationRegistration variable. + * + * @param bool $allowInformationRegistration + * + * @return $this + */ + public function setAllowInformationRegistration($allowInformationRegistration) + { + $this->allowInformationRegistration = $allowInformationRegistration; + return $this; + } + + /** + * Gets departmentId value. + * + * @return string + */ + public function getDepartmentId() + { + return $this->departmentId; + } + + /** + * Sets departmentId variable. + * + * @param string $departmentId + * + * @return $this + */ + public function setDepartmentId($departmentId) + { + $this->departmentId = $departmentId; + return $this; + } + + /** + * Gets onlyProjectManagers value. + * + * @return bool + */ + public function getOnlyProjectManagers() + { + return $this->onlyProjectManagers; + } + + /** + * Sets onlyProjectManagers variable. + * + * @param bool $onlyProjectManagers + * + * @return $this + */ + public function setOnlyProjectManagers($onlyProjectManagers) + { + $this->onlyProjectManagers = $onlyProjectManagers; + return $this; + } + +} +?> diff --git a/src/Model/Employee/ResponseEmployeeList.php b/src/Model/Employee/ResponseEmployeeList.php new file mode 100644 index 0000000..46ac855 --- /dev/null +++ b/src/Model/Employee/ResponseEmployeeList.php @@ -0,0 +1,42 @@ +") + */ + protected $values; + + /** + * Gets values value. + * + * @return \zaporylie\Tripletex\Model\Employee\Employee[] + */ + public function getValues() + { + return $this->values; + } + + /** + * Sets values variable. + * + * @param \zaporylie\Tripletex\Model\Employee\Employee[] $values + * + * @return $this + */ + public function setValues(array $values) + { + $this->values = $values; + return $this; + } +} +?> diff --git a/src/Model/Employee/ResponseEmployeeWrapper.php b/src/Model/Employee/ResponseEmployeeWrapper.php new file mode 100644 index 0000000..91ac8ca --- /dev/null +++ b/src/Model/Employee/ResponseEmployeeWrapper.php @@ -0,0 +1,41 @@ +value; + } + + /** + * Sets value variable. + * + * @param \zaporylie\Tripletex\Model\Employee\Employee $value + * + * @return $this + */ + public function setValue(Employee $value) + { + $this->value = $value; + return $this; + } +} +?> diff --git a/src/Model/Project/Project.php b/src/Model/Project/Project.php index c47e45e..2b72a16 100644 --- a/src/Model/Project/Project.php +++ b/src/Model/Project/Project.php @@ -39,5 +39,103 @@ class Project implements ModelInterface * * @Serializer\Type("zaporylie\Tripletex\Model\Project\ProjectCategory") */ - protected $projectCategory; // (ProjectCategory, optional) + protected $projectCategory; // (ProjectCategory, optional), + + /** + * @var string + * + * @Serializer\Type("string") + */ + protected $description; // (string, optional), + + /** + * @var \zaporylie\Tripletex\Model\Customer\Customer + * + * @Serializer\Type("zaporylie\Tripletex\Model\Customer\Customer") + */ + protected $customer; // (Customer, optional) + + /** + * @var bool + * + * @Serializer\Type("boolean") + */ + protected $isClosed; // (boolean, optional), + + /** + * @var bool + * + * @Serializer\Type("boolean") + */ + + protected $isInternal; // (boolean) Must be set to true. , + + /** + * @var bool + * + * @Serializer\Type("boolean") + */ + protected $isOffer; // (boolean, optional, read only), + + + /** + * Gets projectManager value. + * + * @return \zaporylie\Tripletex\Model\Employee\Employee + */ + public function getProjectManager() + { + return $this->projectManager; + } + + /** + * Gets description value. + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Gets customer value. + * + * @return \zaporylie\Tripletex\Model\Customer\Customer + */ + public function getCustomer() + { + return $this->customer; + } + + /** + * Gets isClosed value. + * + * @return bool + */ + public function getIsClosed() + { + return $this->isClosed; + } + + /** + * Gets isInternal value. + * + * @return bool + */ + public function getIsInternal() + { + return $this->isInternal; + } + + /** + * Gets isOffer value. + * + * @return bool + */ + public function getIsOffer() + { + return $this->isOffer; + } } +?> diff --git a/src/Resource/Employee/EmployeeList.php b/src/Resource/Employee/EmployeeList.php new file mode 100644 index 0000000..40e31be --- /dev/null +++ b/src/Resource/Employee/EmployeeList.php @@ -0,0 +1,63 @@ +app->getClient()->messageFactoryDiscovery()->createRequest( + $this->getMethod(), + $this->getPath().'?'.http_build_query([ + 'id' => $requestObject->getId(), + 'firstName' => $requestObject->getFirstName(), + 'lastName' => $requestObject->getLastName(), + 'employeeNumber' => $requestObject->getEmployeeNumber(), + 'allowInformationRegistration' => $requestObject->getAllowInformationRegistration(), + 'departmentId' => $requestObject->getDepartmentId(), + 'onlyProjectManagers' => $requestObject->getOnlyProjectManagers(), + 'from' => $requestObject->getFrom(), + 'count' => $requestObject->getCount(), + 'sorting' => $requestObject->getSorting(), + 'fields' => $requestObject->getFields() + ]) + ); + + /** @var \Psr\Http\Message\ResponseInterface $response */ + $response = $this->doRequest($request); + + // Get response. + $body = $response->getBody()->getContents(); + + /** @var \zaporylie\Tripletex\Model\Employee\ResponseEmployeeList $responseObject */ + // Deserialize response. + $responseObject = $this->app->getSerializer()->deserialize( + $body, + 'zaporylie\Tripletex\Model\Employee\ResponseEmployeeList', + 'json' + ); + return $responseObject; + } +} diff --git a/src/Tripletex.php b/src/Tripletex.php index 4f980eb..fb2ab77 100644 --- a/src/Tripletex.php +++ b/src/Tripletex.php @@ -11,6 +11,7 @@ use zaporylie\Tripletex\Api\Order; use zaporylie\Tripletex\Api\OrderLine; use zaporylie\Tripletex\Api\Product; +use zaporylie\Tripletex\Api\Employee; use zaporylie\Tripletex\Api\Session; use zaporylie\Tripletex\Api\Address; use zaporylie\Tripletex\Api\Customer; @@ -80,6 +81,14 @@ public function product() return new Product($this); } + /** + * @return \zaporylie\Tripletex\Api\Employee + */ + public function employee() + { + return new Employee($this); + } + /** * @return \zaporylie\Tripletex\Api\Order */