Skip to content

Instantly share code, notes, and snippets.

@jlamim jlamim/Categoria.php
Created Jan 16, 2017

Embed
What would you like to do?
Doctrine e CodeIgniter - Controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Categoria extends CI_Controller {
public function add()
{
// Instancia o objeto Categoria
$categoria = new Entity\Categoria();
// Define um nome para a categoria
$categoria->setNome('Teste 2');
// Aplica a persistência dos dados e executa a inserção no banco
$this->doctrine->em->persist($categoria);
$this->doctrine->em->flush();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.