示例#1
0
 /**
  * Converts Idno entities into ActivityStreams objects
  *
  * @param \Idno\Common\Entity $entity
  * @return array
  */
 function entityToActivityStreamsObject(\Idno\Common\Entity $entity)
 {
     $object = array();
     $owner = $entity->getOwnerID();
     if (!empty($owner) && $owner != $entity->getUUID()) {
         $object['author'] = $this->entityToActivityStreamsObject($entity->getOwner());
     }
     $object['displayName'] = $entity->getTitle();
     $object['id'] = $entity->getUUID();
     $object['objectType'] = $entity->getActivityStreamsObjectType();
     $object['published'] = date('Y-m-d\\TH:i:sP', $entity->created);
     $object['updated'] = date('Y-m-d\\TH:i:sP', $entity->updated);
     $object['url'] = $entity->getURL();
     return $object;
 }