コード例 #1
0
 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
 private function getSubStatementModel()
 {
     $result = null;
     $context = null;
     return new SubStatement($this->actor->getModel(), $this->verb->getModel(), $this->object->getModel(), $result, $context);
 }