/** * @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; }
/** * @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; }