/** * Get one supplServices, given its ID. * * @param mixed $id * @return mixed */ protected function _findOneById($id, $org = null) { if (!strlen((string) $id)) { throw new \Application\Exceptions\InvalidArgumentException(); } $proto = $this->_createProto(self::METHOD_NAME_GETDATA); $proto->setId($id); if ($org) { $orgNew = $this->_createOrganization($org->getId()); $proto->setOrganization($orgNew); } $response = $this->_sendRequest(self::METHOD_NAME_GETDATA, array('protoMessage' => $proto), $this->getEricssonService()); if ($this->_checkGetResponse($response)) { $data = $response->serialize(new \DrSlump\Protobuf\Codec\PhpArray()); if ($data) { unset($data['result']); } $result = new \Application\Model\SupplServicesModel($this->_mapEricssonModelToModel($data)); $result->setId($id); return $result; } return NULL; }
/** * @group EricssonInt */ public function testCreate() { $id = $this->_spMapper->insert($this->_suppServicesPack); $this->assertNotNull($id); $this->_suppServicesPack->setId($id); }
protected function _insertEricsson(\Application\Model\SupplServicesModel $supplServices) { $methodName = self::METHOD_NAME_CREATE; $proto = $this->_createProto($methodName); $createData = new \Application\Proto\SupplServices\SupplServicesSet(); $proto->setCreateData($createData); $mappedData = $this->_mapModelToEricssonModel($supplServices->exportData()); $createData->parse($mappedData, new \DrSlump\Protobuf\Codec\PhpArray()); $response = $this->_sendRequest($methodName, array('protoMessage' => $proto)); $ok = $this->_checkPostResponse($response); if ($ok) { $supplServices->setId($response->getId()); } }