Example #1
0
 public function save()
 {
     $petOwner = new PetOwner();
     $petOwner->setUsername(Session::get('username'));
     $petOwner->setEmail(Session::get('email'));
     $petOwner->setPassword(Session::get('password'));
     $petFactory = new PetFactory(Session::get('planet'), $_POST['kind']);
     $pet = $petFactory->createPet();
     // Usar transação
     DAO::on('PetOwner')->save($petOwner);
     // DAO::on('Pet')->insert($pet);
     header('Location: ' . URL . 'login/run');
 }
Example #2
0
 public function run()
 {
     $pet = DAO::on('Pet')->findById(1);
     Session::set('pet', $pet);
     header('Location: ' . URL . 'pet/index');
 }