public function build() { if ($this->objectID == NULL) { $this->objectID = UOID::createUOID(); } if ($this->featureList == NULL) { $this->featureList = array(); } if ($this->datetime == NULL) { $this->datetime = XSDDateTime::getXSDDateTime(); } if ($this->expires == NULL) { $this->expires = $this->datetime; } if (!UOID::isValid($this->objectID)) { throw new IllegalModelStateException('Invalid objectID'); } $featureList = new FeatureListObject($this); if ($this->signature == NULL) { $featureList->signObject(); } if (!$featureList->verifyObjectSignature()) { throw new IllegalModelStateException('Invalid signature'); } return $featureList; }
public function createPOSTFeatureList(FeatureListObject $featureListObject) { $this->request = new OutgoingRequest(); $this->request->setServer($this->getDomainFromProfileLocation($this->targetSocialRecord->getProfileLocation())); $this->request->setPath($this->getPathFromProfileLocation($this->targetSocialRecord->getProfileLocation()) . $this->targetSocialRecord->getGlobalID() . '/' . self::RESOURCE_NAME_FEATURE); $this->request->setRequestMethod('POST'); $this->request->setRequestBody($featureListObject->getJSONString()); return $this; }