/**
  * @return Entry
  */
 public function toEntry()
 {
     $entry = new Entry();
     $entry->setInstanceId($this->getInstanceId());
     $entry->setProcessId($this->getProcessId());
     $entry->setEndpoint($this->getService()->getEndpoint());
     $entry->setServiceName($this->getServiceName());
     return $entry;
 }
Ejemplo n.º 2
0
 /**
  * @param null|string $serviceName
  * @return Entry[]
  */
 public function findEntries($serviceName = null)
 {
     $query = $serviceName ? array('serviceName' => $serviceName) : array();
     $cursor = $this->getCollection()->find($query);
     $entries = array();
     foreach ($cursor as $doc) {
         $entries[] = Entry::fromStorageArray($doc);
     }
     return $entries;
 }