本文整理汇总了PHP中Service::getServiceType方法的典型用法代码示例。如果您正苦于以下问题:PHP Service::getServiceType方法的具体用法?PHP Service::getServiceType怎么用?PHP Service::getServiceType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service::getServiceType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editEndpoint
public function editEndpoint(\Service $service, \User $user, \EndpointLocation $endpoint, $newValues)
{
//Check the portal is not in read only mode, throws exception if it is
$this->checkPortalIsNotReadOnlyOrUserIsAdmin($user);
$name = $newValues['SERVICEENDPOINT']['NAME'];
$url = $newValues['SERVICEENDPOINT']['URL'];
if ($newValues['SERVICEENDPOINT']['INTERFACENAME'] != '') {
$interfaceName = $newValues['SERVICEENDPOINT']['INTERFACENAME'];
} else {
$interfaceName = (string) $service->getServiceType();
}
$description = $newValues['SERVICEENDPOINT']['DESCRIPTION'];
$this->validate($newValues['SERVICEENDPOINT'], 'endpoint');
if (empty($name)) {
throw new \Exception("An endpoint must have a name.");
}
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
throw new \Exception("An endpoint must have a valid url.");
}
// check endpoint's name is unique under the service
foreach ($service->getEndpointLocations() as $endpointL) {
// exclude itself
if ($endpoint != $endpointL && $endpointL->getName() == $name) {
throw new \Exception("Please provide a unique name for this endpoint.");
}
}
$this->em->getConnection()->beginTransaction();
try {
// Set the endpoints new member variables
$endpoint->setName($name);
$endpoint->setUrl($url);
$endpoint->setInterfaceName($interfaceName);
$endpoint->setDescription($description);
$this->em->merge($endpoint);
$this->em->flush();
$this->em->getConnection()->commit();
} catch (\Exception $ex) {
$this->em->getConnection()->rollback();
$this->em->close();
throw $ex;
}
}
示例2: addServiceToArchive
/**
* Creates an entry in the service archive table, to enable auditing
* of deletion.
* @param \Service $service
* @param \User $user
*/
public function addServiceToArchive(\Service $service, \User $user)
{
$archievedService = new \ArchivedService();
$archievedService->setDeletedBy($user->getCertificateDn());
$archievedService->setHostName($service->getHostName());
$archievedService->setServiceType($service->getServiceType()->getName());
$archievedService->setOriginalCreationDate($service->getCreationDate());
$archievedService->setParentSite($service->getParentSite()->getShortName());
$archievedService->setScopes($service->getScopeNamesAsString());
$archievedService->setMonitored($service->getMonitored());
$archievedService->setBeta($service->getBeta());
$archievedService->setProduction($service->getProduction());
$this->em->persist($archievedService);
}
示例3:
<b><?php
echo CHtml::encode($data->getAttributeLabel('price'));
?>
:</b>
<?php
echo CHtml::encode($data->price);
?>
<br />
<b><?php
echo CHtml::encode($data->getAttributeLabel('service_type_id'));
?>
:</b>
<?php
echo Service::getServiceType($data->service_type_id);
?>
<br />
</div>
<!--<b><?php
echo CHtml::encode($data->getAttributeLabel('active'));
?>
:</b>
<?php
if ($data->active == 1) {
echo CHtml::encode('Si');
} else {
echo CHtml::encode('No');
}
示例4: Exception
$doctrineSe->setMonitored(false);
}
// Set the scope
if ((string) $xmlSe->SCOPE == "EGI") {
$doctrineSe->addScope($egiScope);
} else {
if ((string) $xmlSe->SCOPE == 'Local') {
$doctrineSe->addScope($localScope);
} else {
throw new Exception("Unknown scope " . $xmlSe->SCOPE . " for SE " . $xmlSe->HOSTNAME);
}
}
//set creation date
$creationDate = new \DateTime("now", new DateTimeZone('UTC'));
$doctrineSe->setCreationDate($creationDate);
$doctrineSe->setDn((string) $xmlSe->HOSTDN);
$doctrineSe->setIpAddress((string) $xmlSe->HOST_IP);
$doctrineSe->setOperatingSystem((string) $xmlSe->HOST_OS);
$doctrineSe->setArchitecture((string) $xmlSe->HOST_ARCH);
$doctrineSe->setHostName((string) $xmlSe->HOSTNAME);
$doctrineSe->setDescription((string) $xmlSe->DESCRIPTION);
// A service has ELs
$doctrineEndpointLocation = new EndpointLocation();
$doctrineEndpointLocation->setUrl((string) $xmlSe->URL);
$doctrineEndpointLocation->setName('sampleEndpoint');
$doctrineEndpointLocation->setInterfaceName((string) $doctrineSe->getServiceType()->getName());
$doctrineSe->addEndpointLocationDoJoin($doctrineEndpointLocation);
$entityManager->persist($doctrineSe);
$entityManager->persist($doctrineEndpointLocation);
}
$entityManager->flush();