本文整理汇总了PHP中Categoria::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Categoria::getId方法的具体用法?PHP Categoria::getId怎么用?PHP Categoria::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Categoria
的用法示例。
在下文中一共展示了Categoria::getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: inserir
public function inserir(Categoria $categoria)
{
//Objetivo deste metodo é inserir um objeto no banco, fazendo-o ter persistencia.
//utilizaremos a abstracao do SQL da classe TsqlInstruction
//1. Foreach dos atributos . PRa cada existencia de atributo é um valor a ser adicionado.
$instrucao = new TSqlInsert();
$instrucao->setEntity("categoria");
if ($categoria->getId() != null) {
$instrucao->setRowData("id", $categoria->getId());
}
if ($categoria->getNome() != null) {
$instrucao->setRowData("nome", $categoria->getNome());
}
if ($categoria->getDescricao() != null) {
$instrucao->setRowData("descricao", $categoria->getDescricao());
}
echo $instrucao->getInstruction();
if ($this->Conexao->query($instrucao->getInstruction())) {
return true;
} else {
return false;
}
}
示例2: setCategoria
/**
* Declares an association between this object and a Categoria object.
*
* @param Categoria $v
* @return Pelicula The current object (for fluent API support)
* @throws PropelException
*/
public function setCategoria(Categoria $v = null)
{
if ($v === null) {
$this->setCategoriaId(NULL);
} else {
$this->setCategoriaId($v->getId());
}
$this->aCategoria = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Categoria object, it will not be re-added.
if ($v !== null) {
$v->addPelicula($this);
}
return $this;
}
示例3: prune
/**
* Exclude object from result
*
* @param Categoria $categoria Object to remove from the list of results
*
* @return CategoriaQuery The current query, for fluid interface
*/
public function prune($categoria = null)
{
if ($categoria) {
$this->addUsingAlias(CategoriaPeer::ID, $categoria->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
示例4: filterByCategoria
/**
* Filter the query by a related Categoria object
*
* @param Categoria|PropelCollection $categoria The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return PeliculaQuery The current query, for fluid interface
*/
public function filterByCategoria($categoria, $comparison = null)
{
if ($categoria instanceof Categoria) {
return $this->addUsingAlias(PeliculaPeer::CATEGORIA_ID, $categoria->getId(), $comparison);
} elseif ($categoria instanceof PropelCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(PeliculaPeer::CATEGORIA_ID, $categoria->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterByCategoria() only accepts arguments of type Categoria or PropelCollection');
}
}