public function getModel()
 {
     $result = null;
     $authority = null;
     $created = null;
     $stored = null;
     $context = null;
     $attachments = null;
     if (null !== $this->result) {
         $result = $this->result->getModel();
     }
     if (null !== $this->authority) {
         $authority = $this->authority->getModel();
     }
     if (null !== $this->created) {
         $created = new \DateTime('@' . $this->created);
     }
     if (null !== $this->stored) {
         $stored = new \DateTime('@' . $this->stored);
     }
     if (null !== $this->context) {
         $context = $this->context->getModel();
     }
     if ($this->hasAttachments) {
         $attachments = array();
         foreach ($this->attachments as $attachment) {
             $attachments[] = $attachment->getModel();
         }
     }
     return new StatementModel(StatementId::fromString($this->id), $this->actor->getModel(), $this->verb->getModel(), $this->object->getModel(), $result, $authority, $created, $stored, $context, $attachments);
 }
示例#2
0
 public function getModel()
 {
     $context = new ContextModel();
     $context = $context->withRegistration($this->registration);
     $context = $context->withRevision($this->revision);
     $context = $context->withPlatform($this->platform);
     $context = $context->withLanguage($this->language);
     if (null !== $this->instructor) {
         $context = $context->withInstructor($this->instructor->getModel());
     }
     if (null !== $this->team) {
         $context = $context->withTeam($this->team->getModel());
     }
     if ($this->hasContextActivities) {
         $contextActivities = new ContextActivities();
         if (null !== $this->parentActivities) {
             foreach ($this->parentActivities as $contextParentActivity) {
                 $contextActivities = $contextActivities->withAddedParentActivity($contextParentActivity->getModel());
             }
         }
         if (null !== $this->groupingActivities) {
             foreach ($this->groupingActivities as $contextGroupingActivity) {
                 $contextActivities = $contextActivities->withAddedGroupingActivity($contextGroupingActivity->getModel());
             }
         }
         if (null !== $this->categoryActivities) {
             foreach ($this->categoryActivities as $contextCategoryActivity) {
                 $contextActivities = $contextActivities->withAddedCategoryActivity($contextCategoryActivity->getModel());
             }
         }
         if (null !== $this->otherActivities) {
             foreach ($this->otherActivities as $contextOtherActivity) {
                 $contextActivities = $contextActivities->withAddedOtherActivity($contextOtherActivity->getModel());
             }
         }
         $context = $context->withContextActivities($contextActivities);
     }
     if (null !== $this->statement) {
         $context = $context->withStatement(new StatementReference(StatementId::fromString($this->statement)));
     }
     if (null !== $this->extensions) {
         $context = $context->withExtensions($this->extensions->getModel());
     }
     return $context;
 }
示例#3
0
 private function getSubStatementModel()
 {
     $result = null;
     $context = null;
     return new SubStatement($this->actor->getModel(), $this->verb->getModel(), $this->object->getModel(), $result, $context);
 }