本文整理汇总了PHP中Software::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Software::setId方法的具体用法?PHP Software::setId怎么用?PHP Software::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Software
的用法示例。
在下文中一共展示了Software::setId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retornaSoftwaresComId
public function retornaSoftwaresComId()
{
$sql = "SELECT * FROM software ORDER BY id_software DESC LIMIT 10";
$result = $this->conexao->query($sql);
foreach ($result as $linha) {
$software = new Software();
$software->setNome($linha['nome']);
$software->setLinguagem($linha['linguagem']);
$software->setId($linha['id_software']);
$softwares[] = $software;
}
if (isset($softwares)) {
return $softwares;
} else {
return null;
}
}
示例2: toEntity
public static function toEntity(SoftwareDTO $softwareDTO)
{
$software = new Software();
$software->setId($softwareDTO->getId());
$software->setSoftwareNumeroSerie($softwareDTO->getSoftwareNumeroSerie());
$software->setSoftwareNombre($softwareDTO->getSoftwareNombre());
$software->setSoftwareVersion($softwareDTO->getSoftwareVersion());
$software->setSoftwareFechaCaducidad($softwareDTO->getSoftwareFechaCaducidad());
$software->setSoftwareFechaAquisicion($softwareDTO->getSoftwareFechaAquisicion());
$software->setSoftwareEquiposPermitidos($softwareDTO->getSoftwareEquiposPermitidos());
$software->setSoftwareComentarios($softwareDTO->getSoftwareComentarios());
return $software;
}
示例3: SoftwareDAO
<body>
<div id="topo">
<img src="images/logo.png" alt="" />
</div>
<div id="conteiner">
<?php
if ($_GET['idsoftware']) {
// vou fechar isso lá no final
$_SESSION['meuSoftwareId'] = $_GET['idsoftware'];
$conexao = Conexao::retornaConexaoComBanco();
$softwaredao = new SoftwareDAO();
$softwaredao->setConexao($conexao);
$software = new Software();
$software->setId($_GET['idsoftware']);
$software = $softwaredao->retornaSoftwareDetalhado($software);
?>
<div id="esquerda">
<?php
echo '<h1>' . $software->getNome() . '</h1>';
echo '<h2>Informações:</h2>
<p>Linguagem: ' . $software->getLinguagem();
if ($software->getBancoDeDados()) {
echo '; Banco: ' . $software->getBancoDeDados()->getSistemaGerenciadorDeBancoDeDados() . '</p>';
}
?>
示例4: Atributo
<div id="conteiner">
<div id="esquerda">
<?php
if ($_SESSION['meuSoftwareId'] && $_POST['nomedoatributo']) {
$atributo = new Atributo();
$atributo->setNome($_POST['nomedoatributo']);
$atributo->setTipo($_POST['tipodeatributo']);
$atributo->setIndice($_POST['indice']);
$atributo->setTipoDeRelacionamentoComObjeto($_POST['relacionamento_com_outro_tipo']);
$objeto = new Objeto();
$objeto->setId($_POST['objeto']);
$objeto->addAtributo($atributo);
$software = new Software();
$software->setId($_SESSION['meuSoftwareId']);
$software->addObjetoNaLista($objeto);
$conexao = Conexao::retornaConexaoComBanco();
$atributodao = new AtributoDAO();
$atributodao->setConexao($conexao);
if ($atributodao->inserir($objeto, $atributo)) {
echo "Atributo Inserido Com sucesso!";
echo '<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=software.php?idsoftware=' . $_SESSION['meuSoftwareId'] . '">';
} else {
echo "Atributo Não Inserido";
echo '<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=software.php?idsoftware=' . $_SESSION['meuSoftwareId'] . '">';
}
}
?>
示例5: listComputadoraSoftwaresBySoftwareId
/**
* Listar algunos ComputadoraSoftware dado el $softwareId
*
* @param $softwareId
* @param $performSize
* @param $firstResultNumber
* @param $numResults
*/
public function listComputadoraSoftwaresBySoftwareId($softwareId, $performSize = false, $firstResultNumber = null, $numResults = null, $orderBy = null, $orderPriority = SQL_ASCENDING_ORDER)
{
$objBean = new SoftwareBean($this->persistenceManager);
$obj = new Software();
$obj->setId($softwareId);
# Validamos los campos
if ($firstResultNumber !== null && !EntityValidator::validatePositiveNumber($firstResultNumber)) {
throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 105);
}
if (!EntityValidator::validateGlobalOrderPriority($orderPriority)) {
throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 107);
}
if (!EntityValidator::validateId($softwareId)) {
throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 109);
}
# Verificamos que la entidad exista
if (!$objBean->getSoftware($obj)) {
throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 111);
}
# Listamos las entidades
if ($performSize) {
$this->lastRequestSize = $this->computadoraSoftwareBean->countGetComputadoraSoftwaresBySoftware($obj);
}
return ComputadoraSoftwareDTO::loadFromEntities($this->computadoraSoftwareBean->listComputadoraSoftwaresBySoftware($obj, $firstResultNumber, $numResults, $orderBy, $orderPriority));
}
示例6: removeSoftware
/**
* Eliminar un Software Dado el $softwareId
*
* @param $softwareId
*/
public function removeSoftware($softwareId)
{
$computadoraSoftwareBean = new ComputadoraSoftwareBean($this->persistenceManager);
$software = new Software();
$software->setId($softwareId);
# Validamos los campos
if (!EntityValidator::validateId($softwareId)) {
throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 249);
}
# Verificamos que la entidad exista.
if (!$this->softwareBean->getSoftware($software)) {
throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 250);
}
# Verificamos que la entidad no esté siendo utilziada en alguna otra.
# Verificamos que la entidad no esté siendo utilziada en ComputadoraSoftware->software
$computadoraSoftwares = $computadoraSoftwareBean->getComputadoraSoftwaresBySoftware($software);
if (count($computadoraSoftwares) > 0) {
throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 248);
}
# Eliminamos la entidad
if (!$this->softwareBean->removeSoftware($software)) {
throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 251);
}
}